X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fethernet%2Fpacket.h;h=13d7dafabfcab5e0de47a726e6b5315d6dd92399;hb=b5c0d35f;hp=04ce420c07e799174b0e8799498fec4f691a744e;hpb=b1232555e91b286feab5667b5a22f29aa8e96626;p=vpp.git diff --git a/src/vnet/ethernet/packet.h b/src/vnet/ethernet/packet.h index 04ce420c07e..13d7dafabfc 100644 --- a/src/vnet/ethernet/packet.h +++ b/src/vnet/ethernet/packet.h @@ -64,20 +64,20 @@ typedef struct /* I/G bit: individual (unicast)/group (broadcast/multicast). */ always_inline uword -ethernet_address_cast (const u8 * a) +ethernet_address_cast (u8 * a) { return (a[0] >> 0) & 1; } always_inline int -ethernet_address_is_broadcast (const u8 * a) +ethernet_address_is_broadcast (u8 * a) { return clib_mem_unaligned (a, u32) == 0xffffffff && clib_mem_unaligned (a + 4, u16) == 0xffff; } always_inline uword -ethernet_address_is_locally_administered (const u8 * a) +ethernet_address_is_locally_administered (u8 * a) { return (a[0] >> 1) & 1; } @@ -142,8 +142,8 @@ ethernet_vlan_header_set_priority_net_order (ethernet_vlan_header_t * h, { 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 @@ -151,7 +151,7 @@ ethernet_vlan_header_get_priority_net_order (ethernet_vlan_header_t * h) { u8 *bytes = (u8 *) (&h->priority_cfi_and_id); - return (bytes[0] >> 5); + return (bytes[0] >> 4); } /* VLAN with ethertype first and vlan id second */