summaryrefslogtreecommitdiffstats
path: root/netlink-notify.c
diff options
context:
space:
mode:
Diffstat (limited to 'netlink-notify.c')
-rw-r--r--netlink-notify.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/netlink-notify.c b/netlink-notify.c
index a9d1438..ad8c60e 100644
--- a/netlink-notify.c
+++ b/netlink-notify.c
@@ -30,6 +30,9 @@
#ifndef DEBUG
#define DEBUG 0
#endif
+#ifndef IPV6
+#define IPV6 0
+#endif
#define ICON_NETWORK_CONNECTED "netlink-notify-connected"
#define ICON_NETWORK_DISCONNECTED "netlink-notify-disconnected"
@@ -179,7 +182,11 @@ static int msg_handler (struct sockaddr_nl *nl, struct nlmsghdr *msg) {
rtl = IFA_PAYLOAD (msg);
while (rtl && RTA_OK (rth, rtl)) {
- if (rth->rta_type == IFA_LOCAL)
+ if (rth->rta_type == IFA_LOCAL /* IPv4 */
+#if IPV6
+ || rth->rta_type == IFA_ADDRESS /* IPv6 */
+#endif
+ )
notifystr = newstr_addr(TEXT_NEWADDR, name, ifi->ifi_flags,
ifa->ifa_family, RTA_DATA (rth), ifa->ifa_prefixlen);
rth = RTA_NEXT (rth, rtl);