The branch main has been updated by freqlabs:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=407fb44c920a580a30dfe7d1add796a7b35a5ac7

commit 407fb44c920a580a30dfe7d1add796a7b35a5ac7
Author:     Ryan Moeller <freql...@freebsd.org>
AuthorDate: 2021-04-16 02:32:25 +0000
Commit:     Ryan Moeller <freql...@freebsd.org>
CommitDate: 2021-04-16 02:32:25 +0000

    ifconfig: Reuse media state in ifmedia_getstate
    
    This restores behavior lost in code cleanup, fixing a regression after
    2803fa471e77dc8f227fe00bbf075de7feb10022 where changing media options
    only applies some of the changes, not all.
    
    Reported by:    np
    Reviewed by:    donner
    MFC after:      immediately
    Differential Revision:  https://reviews.freebsd.org/D29741
---
 sbin/ifconfig/ifmedia.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sbin/ifconfig/ifmedia.c b/sbin/ifconfig/ifmedia.c
index 66eb40254889..aacf34a13248 100644
--- a/sbin/ifconfig/ifmedia.c
+++ b/sbin/ifconfig/ifmedia.c
@@ -159,7 +159,10 @@ free:
 struct ifmediareq *
 ifmedia_getstate(void)
 {
-       static struct ifmediareq *ifmr;
+       static struct ifmediareq *ifmr = NULL;
+
+       if (ifmr != NULL)
+               return (ifmr);
 
        if (ifconfig_media_get_mediareq(lifh, name, &ifmr) == -1)
                errc(1, ifconfig_err_errno(lifh),
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to