[IPV6] ADDRCONF: Convert ipv6_get_saddr() to ipv6_dev_get_saddr().
[deliverable/linux.git] / net / ipv6 / addrconf.c
index e40213db9e4c6355e665c8684e4549feca77614d..9b3a2d0e426998dc06a171b25b4cfa7d5abfe125 100644 (file)
@@ -1125,6 +1125,11 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
                        if (hiscore.rule < 7)
                                hiscore.rule++;
 #endif
+
+                       /* Skip rule 8 for orchid -> non-orchid address pairs. */
+                       if (ipv6_addr_orchid(&ifa->addr) && !ipv6_addr_orchid(daddr))
+                               continue;
+
                        /* Rule 8: Use longest matching prefix */
                        if (hiscore.rule < 8) {
                                hiscore.matchlen = ipv6_addr_diff(&ifa_result->addr, daddr);
@@ -1162,14 +1167,7 @@ record_it:
        return 0;
 }
 
-
-int ipv6_get_saddr(struct dst_entry *dst,
-                  struct in6_addr *daddr, struct in6_addr *saddr)
-{
-       return ipv6_dev_get_saddr(dst ? ip6_dst_idev(dst)->dev : NULL, daddr, saddr);
-}
-
-EXPORT_SYMBOL(ipv6_get_saddr);
+EXPORT_SYMBOL(ipv6_dev_get_saddr);
 
 int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
                    unsigned char banned_flags)
@@ -1557,6 +1555,7 @@ addrconf_prefix_route(struct in6_addr *pfx, int plen, struct net_device *dev,
                .fc_expires = expires,
                .fc_dst_len = plen,
                .fc_flags = RTF_UP | flags,
+               .fc_nlinfo.nl_net = &init_net,
        };
 
        ipv6_addr_copy(&cfg.fc_dst, pfx);
@@ -1583,6 +1582,7 @@ static void addrconf_add_mroute(struct net_device *dev)
                .fc_ifindex = dev->ifindex,
                .fc_dst_len = 8,
                .fc_flags = RTF_UP,
+               .fc_nlinfo.nl_net = &init_net,
        };
 
        ipv6_addr_set(&cfg.fc_dst, htonl(0xFF000000), 0, 0, 0);
@@ -1599,6 +1599,7 @@ static void sit_route_add(struct net_device *dev)
                .fc_ifindex = dev->ifindex,
                .fc_dst_len = 96,
                .fc_flags = RTF_UP | RTF_NONEXTHOP,
+               .fc_nlinfo.nl_net = &init_net,
        };
 
        /* prefix length - 96 bits "::d.d.d.d" */
This page took 0.03314 seconds and 5 git commands to generate.