[glib] gnetworkmonitornetlink: filter out IPv6 LL MC changes



commit 243b264fca673d0a4e69cad3d0984474324f86a9
Author: Dan Winship <danw gnome org>
Date:   Tue Jan 28 14:46:37 2014 -0500

    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 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c
index 670969d..fd916b3 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]