]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
netfilter: reduce sparse warnings
authorFlorian Westphal <fw@strlen.de>
Thu, 27 Aug 2015 22:16:21 +0000 (00:16 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 28 Aug 2015 19:04:12 +0000 (21:04 +0200)
bridge/netfilter/ebtables.c:290:26: warning: incorrect type in assignment (different modifiers)
-> remove __pure annotation.

ipv6/netfilter/ip6t_SYNPROXY.c:240:27: warning: cast from restricted __be16
-> switch ntohs to htons and vice versa.

netfilter/core.c:391:30: warning: symbol 'nfq_ct_nat_hook' was not declared. Should it be static?
-> delete it, got removed

net/netfilter/nf_synproxy_core.c:221:48: warning: cast to restricted __be32
-> Use __be32 instead of u32.

Tested with objdiff that these changes do not affect generated code.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/bridge/netfilter/ebtables.c
net/ipv6/netfilter/ip6t_SYNPROXY.c
net/netfilter/core.c
net/netfilter/nf_synproxy_core.c

index 18ca4b24c4183c8382aab9f222a1adde53ad470b..48b6b01295de4d39987f82a39cfd4c6503155f5a 100644 (file)
@@ -176,7 +176,7 @@ ebt_basic_match(const struct ebt_entry *e, const struct sk_buff *skb,
        return 0;
 }
 
-static inline __pure
+static inline
 struct ebt_entry *ebt_next_entry(const struct ebt_entry *entry)
 {
        return (void *)entry + entry->next_offset;
index ebbb754c2111b73c87fe85aa58b3124e0a3032ef..1e4bf99ed16e68c68ca87e997895f66dbca4e789 100644 (file)
@@ -237,7 +237,7 @@ synproxy_send_client_ack(const struct synproxy_net *snet,
        nth->ack_seq    = th->ack_seq;
        tcp_flag_word(nth) = TCP_FLAG_ACK;
        nth->doff       = tcp_hdr_size / 4;
-       nth->window     = ntohs(htons(th->window) >> opts->wscale);
+       nth->window     = htons(ntohs(th->window) >> opts->wscale);
        nth->check      = 0;
        nth->urg_ptr    = 0;
 
index 2a5a0704245cc3cbddbc9b44debc016d8df2b84f..0b939b7ad7241c397b597b773b3b12bcdb20c6e9 100644 (file)
@@ -388,9 +388,6 @@ EXPORT_SYMBOL(nf_conntrack_destroy);
 struct nfq_ct_hook __rcu *nfq_ct_hook __read_mostly;
 EXPORT_SYMBOL_GPL(nfq_ct_hook);
 
-struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook __read_mostly;
-EXPORT_SYMBOL_GPL(nfq_ct_nat_hook);
-
 #endif /* CONFIG_NF_CONNTRACK */
 
 #ifdef CONFIG_NF_NAT_NEEDED
index 8fbbdb09826eefd29105b3e80f87c1e54dbb64a9..888b9558415eb23bedd78b80f1bb458763331e68 100644 (file)
@@ -188,7 +188,7 @@ unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
                                    const struct nf_conn_synproxy *synproxy)
 {
        unsigned int optoff, optend;
-       u32 *ptr, old;
+       __be32 *ptr, old;
 
        if (synproxy->tsoff == 0)
                return 1;
@@ -216,12 +216,12 @@ unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
                        if (op[0] == TCPOPT_TIMESTAMP &&
                            op[1] == TCPOLEN_TIMESTAMP) {
                                if (CTINFO2DIR(ctinfo) == IP_CT_DIR_REPLY) {
-                                       ptr = (u32 *)&op[2];
+                                       ptr = (__be32 *)&op[2];
                                        old = *ptr;
                                        *ptr = htonl(ntohl(*ptr) -
                                                     synproxy->tsoff);
                                } else {
-                                       ptr = (u32 *)&op[6];
+                                       ptr = (__be32 *)&op[6];
                                        old = *ptr;
                                        *ptr = htonl(ntohl(*ptr) +
                                                     synproxy->tsoff);