[NETNS]: Modify the neighbour table code so it handles multiple network namespaces
[safe/jmp/linux-2.6] / net / decnet / dn_route.c
index 28aeba1..938ba7d 100644 (file)
@@ -984,7 +984,7 @@ source_ok:
                 * here
                 */
                if (!try_hard) {
-                       neigh = neigh_lookup_nodev(&dn_neigh_table, &fl.fld_dst);
+                       neigh = neigh_lookup_nodev(&dn_neigh_table, &init_net, &fl.fld_dst);
                        if (neigh) {
                                if ((oldflp->oif &&
                                    (neigh->dev->ifindex != oldflp->oif)) ||
@@ -1196,7 +1196,8 @@ int dn_route_output_sock(struct dst_entry **pprt, struct flowi *fl, struct sock
 
        err = __dn_route_output_key(pprt, fl, flags & MSG_TRYHARD);
        if (err == 0 && fl->proto) {
-               err = xfrm_lookup(pprt, fl, sk, !(flags & MSG_DONTWAIT));
+               err = xfrm_lookup(pprt, fl, sk, (flags & MSG_DONTWAIT) ?
+                                               0 : XFRM_LOOKUP_WAIT);
        }
        return err;
 }
@@ -1550,7 +1551,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
                        kfree_skb(skb);
                        return -ENODEV;
                }
-               skb->protocol = __constant_htons(ETH_P_DNA_RT);
+               skb->protocol = htons(ETH_P_DNA_RT);
                skb->dev = dev;
                cb->src = fl.fld_src;
                cb->dst = fl.fld_dst;
@@ -1587,7 +1588,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
                goto out_free;
        }
 
-       return rtnl_unicast(skb, NETLINK_CB(in_skb).pid);
+       return rtnl_unicast(skb, &init_net, NETLINK_CB(in_skb).pid);
 
 out_free:
        kfree_skb(skb);