summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2013-07-03 14:06:19 +0200
committerGravatar Christian Hesse <mail@eworm.de>2013-07-03 14:06:19 +0200
commit934f6e26ea87e04769010498121f2a0be86d9b68 (patch)
treea667f2e6d89f9c6c14d0138b5567d0b17f02ef18
parent4095a6e8355c0d93e225994d71ff5c5f01476c7a (diff)
downloadnetlink-notify-934f6e26ea87e04769010498121f2a0be86d9b68.tar.gz
netlink-notify-934f6e26ea87e04769010498121f2a0be86d9b68.tar.zst
break the loop if we are finished
-rw-r--r--netlink-notify.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/netlink-notify.c b/netlink-notify.c
index 6444879..88e8d83 100644
--- a/netlink-notify.c
+++ b/netlink-notify.c
@@ -298,6 +298,9 @@ static int msg_handler (struct sockaddr_nl *nl, struct nlmsghdr *msg) {
&& ifa->ifa_scope == RT_SCOPE_UNIVERSE /* no IPv6 scope link */) {
inet_ntop(ifa->ifa_family, RTA_DATA (rth), buf, sizeof(buf));
remove_address(&addresses_seen[ifi->ifi_index], buf, ifa->ifa_prefixlen);
+
+ /* we are done, no need to run more loops */
+ break;
}
rth = RTA_NEXT (rth, rtl);
}