mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
netfilter: nfnetlink: add missing __be16 cast
Sparse flags this as suspicious, because this compares integer with a be16 with no conversion. Its a compat check for old userspace that sends host byte order, so force a be16 cast here. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
f72547473f
commit
ec6f2ff0a3
1 changed files with 1 additions and 1 deletions
|
@ -626,7 +626,7 @@ static void nfnetlink_rcv_skb_batch(struct sk_buff *skb, struct nlmsghdr *nlh)
|
|||
nfgenmsg = nlmsg_data(nlh);
|
||||
skb_pull(skb, msglen);
|
||||
/* Work around old nft using host byte order */
|
||||
if (nfgenmsg->res_id == NFNL_SUBSYS_NFTABLES)
|
||||
if (nfgenmsg->res_id == (__force __be16)NFNL_SUBSYS_NFTABLES)
|
||||
res_id = NFNL_SUBSYS_NFTABLES;
|
||||
else
|
||||
res_id = ntohs(nfgenmsg->res_id);
|
||||
|
|
Loading…
Reference in a new issue