netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Off-by-one error in net/8021q/vlan.c
@ 2011-02-16 10:58 Phil Karn
  2011-02-16 12:51 ` richard -rw- weinberger
  0 siblings, 1 reply; 11+ messages in thread
From: Phil Karn @ 2011-02-16 10:58 UTC (permalink / raw)
  To: kaber; +Cc: netdev

The range check on vlan_id in register_vlan_device is off by one, and it
prevents the creation of a vlan interface for vlan ID 4095. (OSX allows
this, I checked.)

Here's the trivial patch:

--- linux-2.6.37/net/8021q/vlan.c~	2011-01-04 16:50:19.000000000 -0800
+++ linux-2.6.37/net/8021q/vlan.c	2011-02-16 02:43:13.988812958 -0800
@@ -239,7 +239,7 @@
 	char name[IFNAMSIZ];
 	int err;

-	if (vlan_id >= VLAN_VID_MASK)
+	if (vlan_id > VLAN_VID_MASK)
 		return -ERANGE;

 	err = vlan_check_real_dev(real_dev, vlan_id);

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

end of thread, other threads:[~2011-02-21 21:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 10:58 Off-by-one error in net/8021q/vlan.c Phil Karn
2011-02-16 12:51 ` richard -rw- weinberger
2011-02-16 13:22   ` Patrick McHardy
2011-02-16 15:58   ` Phil Karn
2011-02-16 16:10     ` richard -rw- weinberger
2011-02-16 16:28       ` Phil Karn
2011-02-16 16:35         ` richard -rw- weinberger
2011-02-16 16:39         ` Eric Dumazet
2011-02-16 18:41           ` Michał Mirosław
2011-02-21 19:26             ` Brent Cook
2011-02-21 21:47               ` Phil Karn

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).