Module Name: src
Committed By: roy
Date: Wed Apr 12 17:02:51 UTC 2017
Modified Files:
src/usr.sbin/ldpd: socketops.c
Log Message:
Use RO_MSGFILTER.
To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/usr.sbin/ldpd/socketops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/ldpd/socketops.c
diff -u src/usr.sbin/ldpd/socketops.c:1.33 src/usr.sbin/ldpd/socketops.c:1.34
--- src/usr.sbin/ldpd/socketops.c:1.33 Wed Oct 30 08:41:57 2013
+++ src/usr.sbin/ldpd/socketops.c Wed Apr 12 17:02:51 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: socketops.c,v 1.33 2013/10/30 08:41:57 mrg Exp $ */
+/* $NetBSD: socketops.c,v 1.34 2017/04/12 17:02:51 roy Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -817,6 +817,12 @@ the_big_loop(void)
struct pollfd pfd[MAX_POLL_FDS];
struct hello_socket *hs;
nfds_t pollsum;
+#ifdef RO_MSGFILTER
+ unsigned char msgfilter[] = {
+ RTM_NEWADDR, RTM_DELADDR,
+ RTM_ADD, RTM_DELETE, RTM_CHANGE,
+ };
+#endif
assert(MAX_POLL_FDS > 5);
@@ -835,6 +841,10 @@ the_big_loop(void)
route_socket = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC);
setsockopt(route_socket, SOL_SOCKET, SO_USELOOPBACK, &(int){0},
sizeof(int));
+#ifdef RO_MSGFILTER
+ setsockopt(route_socket, PF_ROUTE, RO_MSGFILTER, &msgfilter,
+ sizeof(msgfilter));
+#endif
sock_error = bind_current_routes();
if (sock_error != LDP_E_OK) {