Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ethernet: add sanity checks to p2p_ethernet_add/del
[vpp.git]
/
src
/
vnet
/
ethernet
/
packet.h
diff --git
a/src/vnet/ethernet/packet.h
b/src/vnet/ethernet/packet.h
index
1a0506d
..
13d7daf
100644
(file)
--- a/
src/vnet/ethernet/packet.h
+++ b/
src/vnet/ethernet/packet.h
@@
-142,8
+142,16
@@
ethernet_vlan_header_set_priority_net_order (ethernet_vlan_header_t * h,
{
u8 *bytes = (u8 *) (&h->priority_cfi_and_id);
{
u8 *bytes = (u8 *) (&h->priority_cfi_and_id);
- bytes[0] &= 0x1f;
- bytes[0] |= (prio & 0x7) << 5;
+ bytes[0] &= 0x0f;
+ bytes[0] |= (prio & 0xf) << 4;
+}
+
+always_inline u8
+ethernet_vlan_header_get_priority_net_order (ethernet_vlan_header_t * h)
+{
+ u8 *bytes = (u8 *) (&h->priority_cfi_and_id);
+
+ return (bytes[0] >> 4);
}
/* VLAN with ethertype first and vlan id second */
}
/* VLAN with ethertype first and vlan id second */