aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorEric Dumazet <dada1@cosmosbay.com>2008-11-02 00:22:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-11-02 00:22:23 -0400
commit920a46115ca3fa88990276d98520abab85495b2d (patch)
treea0960e925f2426da9766acfed2dbee144f30299c /net/ipv6/udp.c
parentd1a203eac0ec13cd1c0ba610fe7a55c9bc40473b (diff)
udp: multicast packets need to check namespace
Current UDP multicast delivery is not namespace aware. Signed-off-by: Eric Dumazet <dada1@cosmosbay.com> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e51da8c092fa..71e259e866a1 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -328,7 +328,7 @@ drop:
328 return -1; 328 return -1;
329} 329}
330 330
331static struct sock *udp_v6_mcast_next(struct sock *sk, 331static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
332 __be16 loc_port, struct in6_addr *loc_addr, 332 __be16 loc_port, struct in6_addr *loc_addr,
333 __be16 rmt_port, struct in6_addr *rmt_addr, 333 __be16 rmt_port, struct in6_addr *rmt_addr,
334 int dif) 334 int dif)
@@ -340,7 +340,7 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
340 sk_for_each_from(s, node) { 340 sk_for_each_from(s, node) {
341 struct inet_sock *inet = inet_sk(s); 341 struct inet_sock *inet = inet_sk(s);
342 342
343 if (sock_net(s) != sock_net(sk)) 343 if (!net_eq(sock_net(s), net))
344 continue; 344 continue;
345 345
346 if (s->sk_hash == num && s->sk_family == PF_INET6) { 346 if (s->sk_hash == num && s->sk_family == PF_INET6) {
@@ -383,14 +383,14 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
383 read_lock(&udp_hash_lock); 383 read_lock(&udp_hash_lock);
384 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]); 384 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]);
385 dif = inet6_iif(skb); 385 dif = inet6_iif(skb);
386 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); 386 sk = udp_v6_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif);
387 if (!sk) { 387 if (!sk) {
388 kfree_skb(skb); 388 kfree_skb(skb);
389 goto out; 389 goto out;
390 } 390 }
391 391
392 sk2 = sk; 392 sk2 = sk;
393 while ((sk2 = udp_v6_mcast_next(sk_next(sk2), uh->dest, daddr, 393 while ((sk2 = udp_v6_mcast_next(net, sk_next(sk2), uh->dest, daddr,
394 uh->source, saddr, dif))) { 394 uh->source, saddr, dif))) {
395 struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC); 395 struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC);
396 if (buff) { 396 if (buff) {