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.
@@ -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 *
