Date: Fri, 6 Jan 2017 05:11:16 +0000 From: Phabricator <phabric-noreply@FreeBSD.org> To: freebsd-net@freebsd.org Subject: [Differential] D8905: if: Defer the if_up until the ifnet.if_ioctl is called. Message-ID: <807f9e4043e90606e9f794c1427669e2@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-2f2i7bxvvlt3qp6r23ay-req@FreeBSD.org> References: <differential-rev-PHID-DREV-2f2i7bxvvlt3qp6r23ay-req@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] This revision was automatically updated to reflect the committed changes. Closed by commit rS311475: if: Defer the if_up until the ifnet.if_ioctl is called. (authored by sephe). CHANGED PRIOR TO COMMIT https://reviews.freebsd.org/D8905?vs=23258&id=23645#toc REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST UPDATE https://reviews.freebsd.org/D8905?vs=23258&id=23645 REVISION DETAIL https://reviews.freebsd.org/D8905 AFFECTED FILES head/sys/net/if.c EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: sepherosa_gmail.com, delphij, royger, decui_microsoft.com, honzhan_microsoft.com, howard0su_gmail.com, adrian, hiren, bz, glebius, karels, gnn Cc: jhb, freebsd-net-list [-- Attachment #2 --] diff --git a/head/sys/net/if.c b/head/sys/net/if.c --- a/head/sys/net/if.c +++ b/head/sys/net/if.c @@ -2300,7 +2300,7 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) { struct ifreq *ifr; - int error = 0; + int error = 0, do_ifup = 0; int new_flags, temp_flags; size_t namelen, onamelen; size_t descrlen; @@ -2427,7 +2427,7 @@ if_down(ifp); } else if (new_flags & IFF_UP && (ifp->if_flags & IFF_UP) == 0) { - if_up(ifp); + do_ifup = 1; } /* See if permanently promiscuous mode bit is about to flip */ if ((ifp->if_flags ^ new_flags) & IFF_PPROMISC) { @@ -2446,6 +2446,8 @@ if (ifp->if_ioctl) { (void) (*ifp->if_ioctl)(ifp, cmd, data); } + if (do_ifup) + if_up(ifp); getmicrotime(&ifp->if_lastchange); break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?807f9e4043e90606e9f794c1427669e2>
