[IPV6]: ROUTE: Flag RTF_DEFAULT for Route Infomation for ::/0.
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Tue, 21 Mar 2006 01:06:42 +0000 (17:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 01:06:42 +0000 (17:06 -0800)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c

index 0f30ee3d94eacd3010fbe40ebd442412675f2de3..f587a0e6cf34d04f9e57a9757d522f7f120d0d97 100644 (file)
@@ -1403,6 +1403,9 @@ static struct rt6_info *rt6_add_route_info(struct in6_addr *prefix, int prefixle
        ipv6_addr_copy(&rtmsg.rtmsg_gateway, gwaddr);
        rtmsg.rtmsg_metric = 1024;
        rtmsg.rtmsg_flags = RTF_GATEWAY | RTF_ADDRCONF | RTF_ROUTEINFO | RTF_UP | RTF_PREF(pref);
+       /* We should treat it as a default route if prefix length is 0. */
+       if (!prefixlen)
+               rtmsg.rtmsg_flags |= RTF_DEFAULT;
        rtmsg.rtmsg_ifindex = ifindex;
 
        ip6_route_add(&rtmsg, NULL, NULL, NULL);