Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102692212
D36095.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36095.diff
View Options
diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -957,9 +957,6 @@
EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
if (IS_DEFAULT_VNET(curvnet))
devctl_notify("IFNET", ifp->if_xname, "ATTACH", NULL);
-
- /* Announce the interface. */
- rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
}
static void
@@ -1210,8 +1207,6 @@
#endif
if_purgemaddrs(ifp);
- /* Announce that the interface is gone. */
- rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
if (IS_DEFAULT_VNET(curvnet))
devctl_notify("IFNET", ifp->if_xname, "DETACH", NULL);
@@ -2773,8 +2768,6 @@
*/
ifp->if_flags |= IFF_RENAMING;
- /* Announce the departure of the interface. */
- rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
EVENTHANDLER_INVOKE(ifnet_departure_event, ifp);
if_printf(ifp, "changing name to '%s'\n", new_name);
@@ -2804,8 +2797,6 @@
IF_ADDR_WUNLOCK(ifp);
EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp);
- /* Announce the return of the interface. */
- rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
ifp->if_flags &= ~IFF_RENAMING;
diff --git a/sys/net/route.h b/sys/net/route.h
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -415,7 +415,6 @@
struct rib_head;
void rt_ieee80211msg(struct ifnet *, int, void *, size_t);
-void rt_ifannouncemsg(struct ifnet *, int);
void rt_ifmsg(struct ifnet *);
void rt_missmsg(int, struct rt_addrinfo *, int, int);
void rt_missmsg_fib(int, struct rt_addrinfo *, int, int, int);
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -207,6 +207,7 @@
static void rt_getmetrics(const struct rtentry *rt,
const struct nhop_object *nh, struct rt_metrics *out);
static void rt_dispatch(struct mbuf *, sa_family_t);
+static void rt_ifannouncemsg(struct ifnet *ifp, int what);
static int handle_rtm_get(struct rt_addrinfo *info, u_int fibnum,
struct rt_msghdr *rtm, struct rib_cmd_info *rc);
static int update_rtm_from_rc(struct rt_addrinfo *info,
@@ -272,6 +273,20 @@
vnet_rts_uninit, 0);
#endif
+static void
+rts_handle_ifnet_arrival(void *arg __unused, struct ifnet *ifp)
+{
+ rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
+}
+EVENTHANDLER_DEFINE(ifnet_arrival_event, rts_handle_ifnet_arrival, NULL, 0);
+
+static void
+rts_handle_ifnet_departure(void *arg __unused, struct ifnet *ifp)
+{
+ rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
+}
+EVENTHANDLER_DEFINE(ifnet_departure_event, rts_handle_ifnet_departure, NULL, 0);
+
static void
rts_append_data(struct socket *so, struct mbuf *m)
{
@@ -2112,7 +2127,7 @@
* This is called to generate routing socket messages indicating
* network interface arrival and departure.
*/
-void
+static void
rt_ifannouncemsg(struct ifnet *ifp, int what)
{
struct mbuf *m;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 10:42 PM (22 h, 51 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14666157
Default Alt Text
D36095.diff (2 KB)
Attached To
Mode
D36095: rtsock: subscribe to ifnet eventhandlers instead of direct calls.
Attached
Detach File
Event Timeline
Log In to Comment