Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146940657
D49837.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
810 B
Referenced Files
None
Subscribers
None
D49837.id.diff
View Options
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1273,7 +1273,7 @@
error = nl_parse_nested(lattrs->ifla_idata, &vlan_parser, npt, &attrs);
if (error != 0)
return (error);
- if (attrs.vlan_id > 4095) {
+ if (attrs.vlan_id > DOT1Q_VID_MAX) {
nlmsg_report_err_msg(npt, "Invalid VID: %d", attrs.vlan_id);
return (EINVAL);
}
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h
--- a/sys/net/if_vlan_var.h
+++ b/sys/net/if_vlan_var.h
@@ -130,6 +130,8 @@
#define DOT1Q_VID_DEF_PVID 0x1
#define DOT1Q_VID_DEF_SR_PVID 0x2
#define DOT1Q_VID_RSVD_IMPL 0xfff
+#define DOT1Q_VID_MIN 1 /* minimum valid vlan id */
+#define DOT1Q_VID_MAX 4095 /* maximum valid vlan id */
/*
* 802.1q full tag. Proto and vid are stored in host byte order.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 7, 11:20 PM (2 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29385625
Default Alt Text
D49837.id.diff (810 B)
Attached To
Mode
D49837: sys/net: add DOT1Q_VID_{MIN,MAX}
Attached
Detach File
Event Timeline
Log In to Comment