summaryrefslogtreecommitdiffstats
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-02-23 06:37:07 -0300
committerRenato Botelho <renato@netgate.com>2017-02-23 06:37:07 -0300
commit4ef888db25896b2295f521c736ef04aa2e5e64ec (patch)
tree3fcc00dda536bd32ae85bc09f21be4081d32bad5 /sys/net/if.c
parent272ffd7c3e4e5e27910eb918e2e36556f2a8ec3a (diff)
parentaf015c5bcac0e333adeec07eff0698bad3b91e95 (diff)
downloadFreeBSD-src-4ef888db25896b2295f521c736ef04aa2e5e64ec.zip
FreeBSD-src-4ef888db25896b2295f521c736ef04aa2e5e64ec.tar.gz
Merge remote-tracking branch 'origin/stable/11' into devel-11
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index fa55662..12f867c 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -2218,6 +2218,7 @@ void
if_down(struct ifnet *ifp)
{
+ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_DOWN);
if_unroute(ifp, IFF_UP, AF_UNSPEC);
}
@@ -2230,6 +2231,7 @@ if_up(struct ifnet *ifp)
{
if_route(ifp, IFF_UP, AF_UNSPEC);
+ EVENTHANDLER_INVOKE(ifnet_event, ifp, IFNET_EVENT_UP);
}
/*
@@ -2300,7 +2302,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 +2429,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 +2448,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;
OpenPOWER on IntegriCloud