diff options
Diffstat (limited to 'src/plugins/geneve/geneve_packet.h')
-rw-r--r-- | src/plugins/geneve/geneve_packet.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/geneve/geneve_packet.h b/src/plugins/geneve/geneve_packet.h index a0d0687434c..fb21a311f12 100644 --- a/src/plugins/geneve/geneve_packet.h +++ b/src/plugins/geneve/geneve_packet.h @@ -171,14 +171,15 @@ vnet_set_geneve_version (geneve_header_t * h, u8 version) static inline u8 vnet_get_geneve_options_len (geneve_header_t * h) { - return ((h->first_word & GENEVE_OPTLEN_MASK) >> GENEVE_OPTLEN_SHIFT); + return ((h->first_word & GENEVE_OPTLEN_MASK) >> GENEVE_OPTLEN_SHIFT) << 2; } static inline void vnet_set_geneve_options_len (geneve_header_t * h, u8 len) { + ASSERT ((len & 0x3) == 0); h->first_word &= ~(GENEVE_OPTLEN_MASK); - h->first_word |= ((len << GENEVE_OPTLEN_SHIFT) & GENEVE_OPTLEN_MASK); + h->first_word |= ((len << (GENEVE_OPTLEN_SHIFT - 2)) & GENEVE_OPTLEN_MASK); } static inline u8 |