mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 01:30:30 -04:00
sys/net: add DOT1Q_VID_{MIN,MAX}
add a new typedef in if_vlan_var.h to represent the lowest (1) and
highest (4095) valid VLAN IDs in a .1q tag.
change if_vlan to use DOT1Q_VID_MAX instead of a magic number.
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D49837
(cherry picked from commit c594920250)
This commit is contained in:
parent
1f857ac273
commit
121e035cb5
2 changed files with 3 additions and 1 deletions
|
|
@ -1272,7 +1272,7 @@ vlan_clone_create_nl(struct if_clone *ifc, char *name, size_t len,
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ struct vlanreq {
|
|||
#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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue