Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 179092
b: refs/heads/master
c: 7ad6848
h: refs/heads/master
v: v3
  • Loading branch information
Octavian Purdila authored and David S. Miller committed Jan 7, 2010
1 parent a0030f5 commit 25bce7a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58933c643f86651decc4818cf680f9ec3b0460d2
refs/heads/master: 7ad6848c7e81a603605fad3f3575841aab004eea
16 changes: 16 additions & 0 deletions trunk/include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,22 @@ static __inline__ void inet_reset_saddr(struct sock *sk)

#endif

static inline int sk_mc_loop(struct sock *sk)
{
if (!sk)
return 1;
switch (sk->sk_family) {
case AF_INET:
return inet_sk(sk)->mc_loop;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case AF_INET6:
return inet6_sk(sk)->mc_loop;
#endif
}
__WARN();
return 1;
}

extern int ip_call_ra_chain(struct sk_buff *skb);

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/ipv4/ip_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ int ip_mc_output(struct sk_buff *skb)
*/

if (rt->rt_flags&RTCF_MULTICAST) {
if ((!sk || inet_sk(sk)->mc_loop)
if (sk_mc_loop(sk)
#ifdef CONFIG_IP_MROUTE
/* Small optimization: do not loopback not local frames,
which returned after forwarding; they will be dropped
Expand Down
3 changes: 1 addition & 2 deletions trunk/net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,9 @@ static int ip6_output2(struct sk_buff *skb)
skb->dev = dev;

if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) {
struct ipv6_pinfo* np = skb->sk ? inet6_sk(skb->sk) : NULL;
struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb));

if (!(dev->flags & IFF_LOOPBACK) && (!np || np->mc_loop) &&
if (!(dev->flags & IFF_LOOPBACK) && sk_mc_loop(skb->sk) &&
((mroute6_socket(dev_net(dev)) &&
!(IP6CB(skb)->flags & IP6SKB_FORWARDED)) ||
ipv6_chk_mcast_addr(dev, &ipv6_hdr(skb)->daddr,
Expand Down

0 comments on commit 25bce7a

Please sign in to comment.