diff options
author | ru <ru@FreeBSD.org> | 2002-01-18 14:33:04 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2002-01-18 14:33:04 +0000 |
commit | 7bbde3fb1fe2ff7b5efd1426bdbd435faa950f70 (patch) | |
tree | 868a544aec0071521723bf9f4a0985c76b46ad04 /sys/net/if.c | |
parent | d254e724006714f3f20b2ea58624a58cc97d2874 (diff) | |
download | FreeBSD-src-7bbde3fb1fe2ff7b5efd1426bdbd435faa950f70.zip FreeBSD-src-7bbde3fb1fe2ff7b5efd1426bdbd435faa950f70.tar.gz |
Introduce an interface announcement message for the routing
socket so that routing daemons and other interested parties
know when an interface is attached/detached.
PR: kern/33747
Obtained from: NetBSD
MFC after: 2 weeks
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 7ffb296..8310190 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -430,6 +430,9 @@ if_attach(ifp) TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); } ifp->if_broadcastaddr = 0; /* reliably crash if used uninitialized */ + + /* Announce the interface. */ + rt_ifannouncemsg(ifp, IFAN_ARRIVAL); } /* @@ -511,6 +514,9 @@ if_detach(ifp) (void) rnh->rnh_walktree(rnh, if_rtdel, ifp); } + /* Announce that the interface is gone. */ + rt_ifannouncemsg(ifp, IFAN_DEPARTURE); + KNOTE(&ifp->if_klist, NOTE_EXIT); TAILQ_REMOVE(&ifnet, ifp, if_link); mtx_destroy(&ifp->if_snd.ifq_mtx); |