diff options
| author | Sepherosa Ziehau <sephe@FreeBSD.org> | 2017-01-06 05:10:49 +0000 |
|---|---|---|
| committer | Sepherosa Ziehau <sephe@FreeBSD.org> | 2017-01-06 05:10:49 +0000 |
| commit | cc5bb78be1051973c6e9bc041ced7d7065d89770 (patch) | |
| tree | 99df3bc1bd70dca59368b5fd3516a362b00fe5a3 /sys/net | |
| parent | 9565357905c14dbd2cc761e505f6dca56f8210a2 (diff) | |
Notes
Diffstat (limited to 'sys/net')
| -rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index fa55662b4233..58c8a062ffcd 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2300,7 +2300,7 @@ static int 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 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) 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 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) if (ifp->if_ioctl) { (void) (*ifp->if_ioctl)(ifp, cmd, data); } + if (do_ifup) + if_up(ifp); getmicrotime(&ifp->if_lastchange); break; |
