Reverse sense of promisc tests in ip6_mc_input
Subsystems (3)
PATCH 1/1 Reverse sense of promisc tests in ip6_mc_input
From: Corey Mutter <[email protected]>
Reverse the sense of the promiscuous-mode tests in ip6_mc_input().
---
I had been suspicious of this code for a while, but just assumed I must have been missing something. However, I did some tests and, sure enough, I can open a socket and it will see IPv6 multicast packets come in, then the packets will stop coming in when I turn on IFF_ALLMULTI on the interface.
In my tests, this change works more like I'd expect; I can open a socket, and it doesn't see any multicast packets (unless I join a group or something) until after I turn on IFF_ALLMULTI.
net/ipv6/ip6_input.c +1 -1
@@ -235,7 +235,7 @@ int ip6_mc_input(struct sk_buff *skb)IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_INMCASTPKTS ); hdr = skb->nh.ipv6h; - deliver =likely (!(skb->dev->flags & (IFF_PROMISC |IFF_ALLMULTI ))) || + deliver =unlikely (skb->dev->flags & (IFF_PROMISC |IFF_ALLMULTI )) ||ipv6_chk_mcast_addr (skb->dev, &hdr->daddr,NULL );/*
Your patch looks correct to me.
+-DLS
[email protected] wrote on 05/12/2007 03:51:35 PM:
Quoted 13 lines
From: Corey Mutter <[email protected]>
Reverse the sense of the promiscuous-mode tests in
ip6_mc_input().Signed-off-by Corey Mutter <[email protected]>---
I had been suspicious of this code for a while, but just assumed I must have been missing something. However, I did some tests and, sure enough,
I can open a socket and it will see IPv6 multicast packets come in, then
Quoted 8 lines
the packets will stop coming in when I turn on
IFF_ALLMULTIon the interface.In my tests, this change works more like I'd expect; I can open a socket, and it doesn't see any multicast packets (unless I join a group or something) until after I turn on
IFF_ALLMULTI.---
linux-2.6.21.1/net/ipv6/ip6_input.c2007-04-27 17:49:26.000000000
-0400
Quoted 14 lines
+++
linux/net/ipv6/ip6_input.c2007-05-12 18:19:09.597750000 -0400net/ipv6/ip6_input.c +1
-2@@ -235,7 +235,7 @@ int ip6_mc_input(struct sk_buff *skb)IP6_INC_STATS_BH (ip6_dst_idev (skb->dst),IPSTATS_MIB_INMCASTPKTS ); hdr = skb->nh.ipv6h; - deliver =likely (!(skb->dev->flags & (IFF_PROMISC |IFF_ALLMULTI ))) || + deliver =unlikely (skb->dev->flags & (IFF_PROMISC |IFF_ALLMULTI )) ||ipv6_chk_mcast_addr (skb->dev, &hdr->daddr,NULL );/* -To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Miller
maintainerFrom: David Stevens <[email protected]>
Date: Sat, 12 May 2007 17:21:10 -0700
Quoted 5 lines
Your patch looks correct to me.
+-DLSSigned-off-by David L Stevens <[email protected]>
Patch applied, thanks Corey and David for reviewing.
I'll push this to -stable too.