diff options
author | Yi Yang <yi.y.yang@intel.com> | 2017-08-25 12:02:49 +0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-08-29 08:31:51 -0700 |
commit | bce693e72a4488866dd333a09f94e768dcd8ebaf (patch) | |
tree | 8ae236d5e673ad1e0bf5f3122d725c23e0ef3fd8 /include/openvswitch/nsh.h | |
parent | 75f9e007e7f7eb91461e238f882d1c539c56bb8d (diff) | |
download | openvswitch-bce693e72a4488866dd333a09f94e768dcd8ebaf.tar.gz |
nsh: fix an implicit bug in nsh_hdr_len
Operator '*' will be executed prior to operator '>>',
but we expect operator '>>' is executed prior to '*',
this patch fixed the issue.
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'include/openvswitch/nsh.h')
-rw-r--r-- | include/openvswitch/nsh.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/openvswitch/nsh.h b/include/openvswitch/nsh.h index f4ccadcdc..a3611d089 100644 --- a/include/openvswitch/nsh.h +++ b/include/openvswitch/nsh.h @@ -113,7 +113,7 @@ struct nsh_hdr { static inline uint16_t nsh_hdr_len(const struct nsh_hdr *nsh) { - return 4 * (ntohs(nsh->ver_flags_len) & NSH_LEN_MASK) >> NSH_LEN_SHIFT; + return ((ntohs(nsh->ver_flags_len) & NSH_LEN_MASK) >> NSH_LEN_SHIFT) << 2; } static inline struct nsh_md1_ctx * |