diff options
| author | roy <roy@NetBSD.org> | 2017-04-12 17:02:51 +0000 |
|---|---|---|
| committer | roy <roy@NetBSD.org> | 2017-04-12 17:02:51 +0000 |
| commit | d19e66859e9565261ccf9474beb2bbde7d5e6d8d (patch) | |
| tree | 8caa6a761c12acbf82325f2c9457141d480601f7 | |
| parent | 5a060604cc11d00c154b847ddee753270dada097 (diff) | |
Use RO_MSGFILTER.
| -rw-r--r-- | usr.sbin/ldpd/socketops.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/ldpd/socketops.c b/usr.sbin/ldpd/socketops.c index 4e375012cfd..44e124c3467 100644 --- a/usr.sbin/ldpd/socketops.c +++ b/usr.sbin/ldpd/socketops.c @@ -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) { |
