netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit
@ 2008-01-10 15:45 Patrick McHardy
  2008-01-10 16:34 ` [NETFILTER try 2]: " Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2008-01-10 15:45 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 1540 bytes --]

[VLAN]: nested VLAN: fix lockdep's recursive locking warning

Allow vlans nesting other vlans without lockdep's warnings (max. 2 levels
i.e. parent + child). Thanks to Patrick McHardy for pointing a bug in the
first version of this patch.

Reported-by: Benny Amorsen

Signed-off-by: Jarek Poplawski <jarkao2@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 4d14fded63dcaf9d5dcf78e2a8ea3f5de2c29eb9
tree 2f0792e8240151b1e5437b05130d1f569175f572
parent e2474f60798c97f5c05d29a906045dd1f416ba7f
author Jarek Poplawski <jarkao2@gmail.com> Thu, 10 Jan 2008 16:25:00 +0100
committer Patrick McHardy <kaber@trash.net> Thu, 10 Jan 2008 16:25:00 +0100

 net/8021q/vlan.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index 4add9bd..032bf44 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -323,6 +323,7 @@ static const struct header_ops vlan_header_ops = {
 static int vlan_dev_init(struct net_device *dev)
 {
 	struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
+	int subclass = 0;
 
 	/* IFF_BROADCAST|IFF_MULTICAST; ??? */
 	dev->flags  = real_dev->flags & ~IFF_UP;
@@ -349,7 +350,11 @@ static int vlan_dev_init(struct net_device *dev)
 		dev->hard_start_xmit = vlan_dev_hard_start_xmit;
 	}
 
-	lockdep_set_class(&dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
+	if (real_dev->priv_flags & IFF_802_1Q_VLAN)
+		subclass = 1;
+
+	lockdep_set_class_and_subclass(&dev->_xmit_lock,
+				&vlan_netdev_xmit_lock_key, subclass);
 	return 0;
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [NETFILTER try 2]: ip6t_eui64: Fixes calculation of Universal/Local bit
  2008-01-10 15:45 [NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit Patrick McHardy
@ 2008-01-10 16:34 ` Patrick McHardy
  2008-01-11  6:40   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2008-01-10 16:34 UTC (permalink / raw)
  To: David S. Miller; +Cc: Netfilter Development Mailinglist

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 01.diff --]
[-- Type: text/x-patch, Size: 1302 bytes --]

[NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit

RFC2464 says that the next to lowerst order bit of the first octet
of the Interface Identifier is formed by complementing
the Universal/Local bit of the EUI-64. But ip6t_eui64 uses OR not XOR.

Thanks Peter Ivancik for reporing this bug and posting a patch
for it.

Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
Signed-off-by: Patrick McHardy <kaber@trash.net>

---
commit 7bd5c38839308e24911fffa749b3e53391c7de14
tree ad132f231a7a65312af368dc608714b5e595bc22
parent fd0b45dfd1858c6b49d06355a460bcf36d654c06
author Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp> Wed, 26 Dec 2007 15:57:39 +0900
committer Patrick McHardy <kaber@trash.net> Thu, 10 Jan 2008 16:44:14 +0100

 net/ipv6/netfilter/ip6t_eui64.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c
index 34ba150..41df9a5 100644
--- a/net/ipv6/netfilter/ip6t_eui64.c
+++ b/net/ipv6/netfilter/ip6t_eui64.c
@@ -47,7 +47,7 @@ match(const struct sk_buff *skb,
 			memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3);
 			eui64[3] = 0xff;
 			eui64[4] = 0xfe;
-			eui64[0] |= 0x02;
+			eui64[0] ^= 0x02;
 
 			i = 0;
 			while (ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [NETFILTER try 2]: ip6t_eui64: Fixes calculation of Universal/Local bit
  2008-01-10 16:34 ` [NETFILTER try 2]: " Patrick McHardy
@ 2008-01-11  6:40   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2008-01-11  6:40 UTC (permalink / raw)
  To: kaber; +Cc: netfilter-devel

From: Patrick McHardy <kaber@trash.net>
Date: Thu, 10 Jan 2008 17:34:23 +0100

> [NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit
> 
> RFC2464 says that the next to lowerst order bit of the first octet
> of the Interface Identifier is formed by complementing
> the Universal/Local bit of the EUI-64. But ip6t_eui64 uses OR not XOR.
> 
> Thanks Peter Ivancik for reporing this bug and posting a patch
> for it.
> 
> Signed-off-by: Yasuyuki Kozakai <yasuyuki.kozakai@toshiba.co.jp>
> Signed-off-by: Patrick McHardy <kaber@trash.net>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-01-11  6:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-10 15:45 [NETFILTER]: ip6t_eui64: Fixes calculation of Universal/Local bit Patrick McHardy
2008-01-10 16:34 ` [NETFILTER try 2]: " Patrick McHardy
2008-01-11  6:40   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).