net: ethernet: Fix vlan tag verification
`net_eth_vlan_enable()` allowed to use illegal vlan tag values, fix this by disallowing any tag value higher or equal to 0xfff (which is a limit for the tag and a reserved value). Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
d42cef17b0
commit
85e2bf2a2c
1 changed files with 1 additions and 1 deletions
|
@ -941,7 +941,7 @@ int net_eth_vlan_enable(struct net_if *iface, uint16_t tag)
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == NET_VLAN_TAG_UNSPEC) {
|
if (tag >= NET_VLAN_TAG_UNSPEC) {
|
||||||
return -EBADF;
|
return -EBADF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue