[glib/glib-2-40] networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work on struct in6_addr*



commit c7a661988eb8fd18fb02565d83f52b0136fd3e85
Author: Olivier Crête <olivier crete collabora com>
Date:   Wed Mar 26 19:45:52 2014 -0400

    networkmonitornetlink: IN6_IS_ADDR_MC_LINKLOCAL is only guaranteed to work on struct in6_addr*
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727119

 gio/gnetworkmonitornetlink.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c
index fd916b3..21a7ad5 100644
--- a/gio/gnetworkmonitornetlink.c
+++ b/gio/gnetworkmonitornetlink.c
@@ -382,10 +382,13 @@ read_netlink_messages (GSocket      *socket,
                * IPv6 link-local multicast routes, which are added and
                * removed all the time for some reason.
                */
+#define UNALIGNED_IN6_IS_ADDR_MC_LINKLOCAL(a)           \
+              ((a[0] == 0xff) && ((a[1] & 0xf) == 0x2))
+
               if (!nl->priv->dump_networks &&
                   rtmsg->rtm_family == AF_INET6 &&
                   rtmsg->rtm_dst_len != 0 &&
-                  IN6_IS_ADDR_MC_LINKLOCAL (dest))
+                  UNALIGNED_IN6_IS_ADDR_MC_LINKLOCAL (dest))
                 continue;
 
               if (msg->nlmsg_type == RTM_NEWROUTE)


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