summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-01-21 15:40:13 +0100
committerHans Dedecker <dedeckeh@gmail.com>2017-01-21 15:47:20 +0100
commitc8ac572154981ca833dad92d7ee7aa62b88087cc (patch)
treee48087ff312db2f68125b40c399e2fa367e600cc /src
parentef3c5632c100fda0fa463a3ed56ff926f3f86b20 (diff)
ndp: don't scan netlink attributes in case of netlink route event
In case a netlink route event is received for a default route netlink data attributes were faulty processed as neigbor netlink data. Fix this by not processing any netlink attribute for any route event. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/ndp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ndp.c b/src/ndp.c
index 95eb18f..f9e0405 100644
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -358,11 +358,13 @@ static void handle_rtnetlink(_unused void *addr, void *data, size_t len,
|| ndm->ndm_family != AF_INET6)
continue;
- // Inform about a change in default route
- if (is_route && rtm->rtm_dst_len == 0)
- raise(SIGUSR1);
- else if (is_route)
+ if (is_route) {
+ // Inform about a change in default route
+ if (rtm->rtm_dst_len == 0)
+ raise(SIGUSR1);
+
continue;
+ }
// Data to retrieve
size_t rta_offset = (is_addr) ? sizeof(struct ifaddrmsg) : sizeof(*ndm);