X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=gio%2Fgnetworkmonitornetlink.c;h=21a7ad543d49e331a8ac534cc2e9d79809e3ab50;hb=627b49b39039d43a784fa9890f473d1ca8d52417;hp=4f7d089aa553aaf128e7f920deb173c33ff7ac21;hpb=c08ef6c165c6935f257d3fb98c049be50e3816da;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gnetworkmonitornetlink.c b/gio/gnetworkmonitornetlink.c index 4f7d089..21a7ad5 100644 --- a/gio/gnetworkmonitornetlink.c +++ b/gio/gnetworkmonitornetlink.c @@ -13,14 +13,13 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place, Suite 330, - * Boston, MA 02111-1307, USA. + * Public License along with this library; if not, see . */ #include "config.h" #include +#include #include #include "gnetworkmonitornetlink.h" @@ -379,6 +378,19 @@ 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. + */ +#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 && + UNALIGNED_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