Commit 5fd02ebe authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso

netfilter: fix a few (harmless) sparse warnings

net/netfilter/nft_payload.c:187:18: warning: incorrect type in return expression (expected bool got restricted __sum16 [usertype] check)
net/netfilter/nft_exthdr.c:222:14: warning: cast to restricted __be32
net/netfilter/nft_rt.c:49:23: warning: incorrect type in assignment (different base types expected unsigned int got restricted __be32)
net/netfilter/nft_rt.c:70:25: warning: symbol 'nft_rt_policy' was not declared. Should it be static?
Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent c816c255
...@@ -388,7 +388,7 @@ nft_exthdr_select_ops(const struct nft_ctx *ctx, ...@@ -388,7 +388,7 @@ nft_exthdr_select_ops(const struct nft_ctx *ctx,
if (tb[NFTA_EXTHDR_SREG] && tb[NFTA_EXTHDR_DREG]) if (tb[NFTA_EXTHDR_SREG] && tb[NFTA_EXTHDR_DREG])
return ERR_PTR(-EOPNOTSUPP); return ERR_PTR(-EOPNOTSUPP);
op = ntohl(nla_get_u32(tb[NFTA_EXTHDR_OP])); op = ntohl(nla_get_be32(tb[NFTA_EXTHDR_OP]));
switch (op) { switch (op) {
case NFT_EXTHDR_OP_TCPOPT: case NFT_EXTHDR_OP_TCPOPT:
if (tb[NFTA_EXTHDR_SREG]) if (tb[NFTA_EXTHDR_SREG])
......
...@@ -184,7 +184,7 @@ static bool nft_payload_udp_checksum(struct sk_buff *skb, unsigned int thoff) ...@@ -184,7 +184,7 @@ static bool nft_payload_udp_checksum(struct sk_buff *skb, unsigned int thoff)
if (!uh) if (!uh)
return false; return false;
return uh->check; return (__force bool)uh->check;
} }
static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt, static int nft_payload_l4csum_offset(const struct nft_pktinfo *pkt,
......
...@@ -82,8 +82,8 @@ static void nft_rt_get_eval(const struct nft_expr *expr, ...@@ -82,8 +82,8 @@ static void nft_rt_get_eval(const struct nft_expr *expr,
if (nft_pf(pkt) != NFPROTO_IPV4) if (nft_pf(pkt) != NFPROTO_IPV4)
goto err; goto err;
*dest = rt_nexthop((const struct rtable *)dst, *dest = (__force u32)rt_nexthop((const struct rtable *)dst,
ip_hdr(skb)->daddr); ip_hdr(skb)->daddr);
break; break;
case NFT_RT_NEXTHOP6: case NFT_RT_NEXTHOP6:
if (nft_pf(pkt) != NFPROTO_IPV6) if (nft_pf(pkt) != NFPROTO_IPV6)
...@@ -106,7 +106,7 @@ static void nft_rt_get_eval(const struct nft_expr *expr, ...@@ -106,7 +106,7 @@ static void nft_rt_get_eval(const struct nft_expr *expr,
regs->verdict.code = NFT_BREAK; regs->verdict.code = NFT_BREAK;
} }
const struct nla_policy nft_rt_policy[NFTA_RT_MAX + 1] = { static const struct nla_policy nft_rt_policy[NFTA_RT_MAX + 1] = {
[NFTA_RT_DREG] = { .type = NLA_U32 }, [NFTA_RT_DREG] = { .type = NLA_U32 },
[NFTA_RT_KEY] = { .type = NLA_U32 }, [NFTA_RT_KEY] = { .type = NLA_U32 },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment