aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2015-03-09 18:04:15 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2015-03-10 10:01:32 -0400
commita03a8dbe20eff6d57aae3147577bf84b52aba4e6 (patch)
tree3460950cb98879361087e392078c0dfd4dba9912 /net
parent8ac467e837a24eb024177b4b01013d8e6764913a (diff)
netfilter: fix sparse warnings in reject handling
make C=1 CF=-D__CHECK_ENDIAN__ shows following: net/bridge/netfilter/nft_reject_bridge.c:65:50: warning: incorrect type in argument 3 (different base types) net/bridge/netfilter/nft_reject_bridge.c:65:50: expected restricted __be16 [usertype] protocol [..] net/bridge/netfilter/nft_reject_bridge.c:102:37: warning: cast from restricted __be16 net/bridge/netfilter/nft_reject_bridge.c:102:37: warning: incorrect type in argument 1 (different base types) [..] net/bridge/netfilter/nft_reject_bridge.c:121:50: warning: incorrect type in argument 3 (different base types) [..] net/bridge/netfilter/nft_reject_bridge.c:168:52: warning: incorrect type in argument 3 (different base types) [..] net/bridge/netfilter/nft_reject_bridge.c:233:52: warning: incorrect type in argument 3 (different base types) [..] Caused by two (harmless) errors: 1. htons() instead of ntohs() 2. __be16 for protocol in nf_reject_ipXhdr_put API, use u8 instead. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/bridge/netfilter/nft_reject_bridge.c2
-rw-r--r--net/ipv4/netfilter/nf_reject_ipv4.c2
-rw-r--r--net/ipv6/netfilter/nf_reject_ipv6.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
index 5c6c96585acd..54a2fdf0f457 100644
--- a/net/bridge/netfilter/nft_reject_bridge.c
+++ b/net/bridge/netfilter/nft_reject_bridge.c
@@ -99,7 +99,7 @@ static void nft_reject_br_send_v4_unreach(struct sk_buff *oldskb,
99 if (!pskb_may_pull(oldskb, len)) 99 if (!pskb_may_pull(oldskb, len))
100 return; 100 return;
101 101
102 if (pskb_trim_rcsum(oldskb, htons(ip_hdr(oldskb)->tot_len))) 102 if (pskb_trim_rcsum(oldskb, ntohs(ip_hdr(oldskb)->tot_len)))
103 return; 103 return;
104 104
105 if (ip_hdr(oldskb)->protocol == IPPROTO_TCP || 105 if (ip_hdr(oldskb)->protocol == IPPROTO_TCP ||
diff --git a/net/ipv4/netfilter/nf_reject_ipv4.c b/net/ipv4/netfilter/nf_reject_ipv4.c
index b7405eb7f1ef..c5b794da51a9 100644
--- a/net/ipv4/netfilter/nf_reject_ipv4.c
+++ b/net/ipv4/netfilter/nf_reject_ipv4.c
@@ -43,7 +43,7 @@ EXPORT_SYMBOL_GPL(nf_reject_ip_tcphdr_get);
43 43
44struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb, 44struct iphdr *nf_reject_iphdr_put(struct sk_buff *nskb,
45 const struct sk_buff *oldskb, 45 const struct sk_buff *oldskb,
46 __be16 protocol, int ttl) 46 __u8 protocol, int ttl)
47{ 47{
48 struct iphdr *niph, *oiph = ip_hdr(oldskb); 48 struct iphdr *niph, *oiph = ip_hdr(oldskb);
49 49
diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c
index 68e0bb4db1bf..3afdce03d94e 100644
--- a/net/ipv6/netfilter/nf_reject_ipv6.c
+++ b/net/ipv6/netfilter/nf_reject_ipv6.c
@@ -65,7 +65,7 @@ EXPORT_SYMBOL_GPL(nf_reject_ip6_tcphdr_get);
65 65
66struct ipv6hdr *nf_reject_ip6hdr_put(struct sk_buff *nskb, 66struct ipv6hdr *nf_reject_ip6hdr_put(struct sk_buff *nskb,
67 const struct sk_buff *oldskb, 67 const struct sk_buff *oldskb,
68 __be16 protocol, int hoplimit) 68 __u8 protocol, int hoplimit)
69{ 69{
70 struct ipv6hdr *ip6h; 70 struct ipv6hdr *ip6h;
71 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb); 71 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);