Netdev List
 help / color / mirror / Atom feed
* [PATCH] bridge: vlan: reject reserved VLAN ID 4095
@ 2026-05-11  1:23 William Gonzalez
  2026-05-17 22:30 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: William Gonzalez @ 2026-05-11  1:23 UTC (permalink / raw)
  To: netdev; +Cc: William Gonzalez

The bridge vlan parser currently rejects VLAN IDs greater than or
equal to 4096, which still allows VLAN ID 4095. VLAN ID 4095 is
reserved and should not be accepted as a configurable VLAN ID.

Tighten userspace validation to accept only VLAN IDs in the range
1..4094.

Signed-off-by: William Gonzalez <gonzalez.williamalexander1@gmail.com>
---
 bridge/vlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bridge/vlan.c b/bridge/vlan.c
index 27d31ba8..09c01153 100644
--- a/bridge/vlan.c
+++ b/bridge/vlan.c
@@ -224,8 +224,8 @@ static int vlan_modify(int cmd, int argc, char **argv)
 		return -1;
 	}
 
-	if (vid >= 4096) {
-		fprintf(stderr, "Invalid VLAN ID \"%hu\"\n", vid);
+	if (vid < 1 || vid > 4094) {
+		fprintf(stderr, "Invalid VLAN ID \"%d\"\n", vid);
 		return -1;
 	}
 
-- 
2.39.3 (Apple Git-145)


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

end of thread, other threads:[~2026-05-17 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11  1:23 [PATCH] bridge: vlan: reject reserved VLAN ID 4095 William Gonzalez
2026-05-17 22:30 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox