summaryrefslogtreecommitdiffstats
path: root/sys/net/if_vlan_var.h
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-07-08 21:54:20 +0000
committerwpaul <wpaul@FreeBSD.org>2003-07-08 21:54:20 +0000
commit28f4067fe0887b4870b0ec63b897ff1fa41e4602 (patch)
tree6f84b49a8bcfcf5b569a0de0d834d322e814d4ed /sys/net/if_vlan_var.h
parent47a98bb53f8b27b9616468f768ea8bfa892ee106 (diff)
downloadFreeBSD-src-28f4067fe0887b4870b0ec63b897ff1fa41e4602.zip
FreeBSD-src-28f4067fe0887b4870b0ec63b897ff1fa41e4602.tar.gz
- In vlan_input(), always mask off all but the VLID bits from tags
extracted from received frames, both in the IFCAP_VLAN_HWTAGGING case and not. (Some drivers may already do this masking internally, but doing it here doesn't hurt and insures consistency.) - In vlan_ioctl(), don't let the user set a VLAN ID value with anything besides the VLID bits set, otherwise we will have trouble matching an interface in vlan_input() later. PR: kern/46405
Diffstat (limited to 'sys/net/if_vlan_var.h')
-rw-r--r--sys/net/if_vlan_var.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/net/if_vlan_var.h b/sys/net/if_vlan_var.h
index ff656a6..409db00 100644
--- a/sys/net/if_vlan_var.h
+++ b/sys/net/if_vlan_var.h
@@ -40,7 +40,8 @@ struct ether_vlan_header {
u_int16_t evl_proto;
};
-#define EVL_VLANOFTAG(tag) ((tag) & 4095)
+#define EVL_VLID_MASK 0x0FFF
+#define EVL_VLANOFTAG(tag) ((tag) & EVL_VLID_MASK)
#define EVL_PRIOFTAG(tag) (((tag) >> 13) & 7)
/* sysctl(3) tags, for compatibility purposes */
OpenPOWER on IntegriCloud