Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/ldpd Use RO_MSGFILTER.



details:   https://anonhg.NetBSD.org/src/rev/b143f705408f
branches:  trunk
changeset: 823103:b143f705408f
user:      roy <roy%NetBSD.org@localhost>
date:      Wed Apr 12 17:02:51 2017 +0000

description:
Use RO_MSGFILTER.

diffstat:

 usr.sbin/ldpd/socketops.c |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 33884e6c9d3b -r b143f705408f usr.sbin/ldpd/socketops.c
--- a/usr.sbin/ldpd/socketops.c Wed Apr 12 16:47:39 2017 +0000
+++ b/usr.sbin/ldpd/socketops.c Wed Apr 12 17:02:51 2017 +0000
@@ -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 @@
        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 @@
        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) {



Home | Main Index | Thread Index | Old Index