From 6214212e06a03d94891561fd4e9af83b6ecafcff Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 15 May 2013 21:47:57 +0200 Subject: add option for IPv6 define IPV6=1 to use this --- netlink-notify.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3-70-g09d2