OpenVZ Forum - RDF feed
type: channel
items: [patch 38/38][IPV6] ndisc - make ndisc handle multiple network namespaces

[patch 38/38][IPV6] ndisc - make ndisc handle multiple network namespaces
type: item
description: Make ndisc handle multiple network namespaces: Remove references to init_net, add network namespace parameters and add pernet_operations for ndisc Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by: Benjamin Thery <benjamin.thery@bull.net> --- net/ipv6/ndisc.c | 90 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 35 deletions(-) Index: linux-2.6-netns/net/ipv6/ndisc.c =================================================================== --- linux-2.6-netns.orig/net/ipv6/ndisc.c +++ linux-2.6-netns/net/ipv6/ndisc.c @@ -442,12 +442,12 @@ static void pndisc_destructor(struct pne * Send a Neighbour Advertisement */ -static inline void ndisc_flow_init(struct flowi *fl, u8 type, +static inline void ndisc_flow_init(struct net *net, struct flowi *fl, u8 type, struct in6_addr *saddr, struct in6_addr *daddr, int oif) { memset(fl, 0, sizeof(*fl)); - fl->fl_net = &init_net; + fl->fl_net = net; ipv6_addr_copy(&fl->fl6_src, saddr); ipv6_addr_copy(&fl->fl6_dst, daddr); fl->proto = IPPROTO_ICMPV6; @@ -475,7 +475,7 @@ static void __ndisc_send(struct net_devi type = icmp6h->icmp6_type; - ndisc_flow_init(&fl, type, saddr, daddr, + ndisc_flow_init(dev->nd_net, &fl, type, saddr, daddr, dev->ifindex); dst = ndisc_dst_alloc(dev, neigh, daddr, ip6_output); @@ -791,7 +791,7 @@ static void ndisc_recv_ns(struct sk_buff if (ipv6_chk_acast_addr(dev, &msg->target) || (idev->cnf.forwarding && (ipv6_devconf.proxy_ndp || idev->cnf.proxy_ndp) && - (pneigh = pneigh_lookup(&nd_tbl, &init_net, + (pneigh = pneigh_lookup(&nd_tbl, dev->nd_net, &msg->target, dev, 0)) != NULL)) { if (!(NEIGH_CB(skb)->flags & LOCALLY_ENQUEUED) && skb->pkt_type != PACKET_HOST && @@ -932,7 +932,7 @@ static void ndisc_recv_na(struct sk_buff */ if (lladdr && !memcmp(lladdr, dev->dev_addr, dev->addr_len) && ipv6_devconf.forwarding && ipv6_devconf.proxy_ndp && - pneigh_lookup(&nd_tbl, &init_net, &msg->target, dev, 0)) { + pneigh_lookup(&nd_tbl, dev->nd_net, &msg->target, dev, 0…
creator: Daniel Lezcano
date: 2007-12-03T16:17:14-00:00