From 243b264fca673d0a4e69cad3d0984474324f86a9 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 28 Jan 2014 14:46:37 -0500 Subject: [PATCH] gnetworkmonitornetlink: filter out IPv6 LL MC changes For some reason, IPv6 link-local multicast routing changes all the time. GNetworkMonitorBase was already ignoring them for purposes of emitting network-changed, but GNetworkMonitorNetlink would still trigger a re-dump after getting one, so network-changed would end up getting emitted anyway. --- gio/gnetworkmonitornetlink.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c index 670969d05..fd916b322 100644 --- a/gio/gnetworkmonitornetlink.c +++ b/gio/gnetworkmonitornetlink.c @@ -378,6 +378,16 @@ read_netlink_messages (GSocket *socket, if (dest || gateway || oif) { + /* Unless we're processing the results of a dump, ignore + * IPv6 link-local multicast routes, which are added and + * removed all the time for some reason. + */ + if (!nl->priv->dump_networks && + rtmsg->rtm_family == AF_INET6 && + rtmsg->rtm_dst_len != 0 && + IN6_IS_ADDR_MC_LINKLOCAL (dest)) + continue; + if (msg->nlmsg_type == RTM_NEWROUTE) add_network (nl, rtmsg->rtm_family, rtmsg->rtm_dst_len, dest); else