diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-01-19 19:55:42 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-02-19 05:41:25 -0500 |
commit | 2ba436fc02f95446bfcb7138db44920ab63deb61 (patch) | |
tree | 639fc1cc5dab83c490b5673d9db8f1dc2d5bf911 | |
parent | 3d0a06207fb6bbe7c2f444f38e86ebcdb34c97c3 (diff) |
netfilter: xt_ipcomp: Use ntohs to ease sparse warning
0-DAY kernel build testing backend reported:
sparse warnings: (new ones prefixed by >>)
>> >> net/netfilter/xt_ipcomp.c:63:26: sparse: restricted __be16 degrades to integer
>> >> net/netfilter/xt_ipcomp.c:63:26: sparse: cast to restricted __be32
Fix this by using ntohs without shifting.
Tested with: make C=1 CF=-D__CHECK_ENDIAN__
Signed-off-by: Fan Du <fan.du@windriver.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/netfilter/xt_ipcomp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c index a4c7561698c5..89d53104c6b3 100644 --- a/net/netfilter/xt_ipcomp.c +++ b/net/netfilter/xt_ipcomp.c | |||
@@ -60,7 +60,7 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | return spi_match(compinfo->spis[0], compinfo->spis[1], | 62 | return spi_match(compinfo->spis[0], compinfo->spis[1], |
63 | ntohl(chdr->cpi << 16), | 63 | ntohs(chdr->cpi), |
64 | !!(compinfo->invflags & XT_IPCOMP_INV_SPI)); | 64 | !!(compinfo->invflags & XT_IPCOMP_INV_SPI)); |
65 | } | 65 | } |
66 | 66 | ||