]> err.no Git - linux-2.6/blobdiff - net/netfilter/nf_conntrack_expect.c
[NETFILTER]: nf_conntrack_h3223: sparse fixes
[linux-2.6] / net / netfilter / nf_conntrack_expect.c
index 175c8d1a199219ee57144b9c1d0574c4374abf01..e405079e5a492ff6cc57eaa0d6dc9c7b82b9ee3d 100644 (file)
@@ -73,15 +73,17 @@ static void nf_ct_expectation_timed_out(unsigned long ul_expect)
 
 static unsigned int nf_ct_expect_dst_hash(const struct nf_conntrack_tuple *tuple)
 {
+       unsigned int hash;
+
        if (unlikely(!nf_ct_expect_hash_rnd_initted)) {
                get_random_bytes(&nf_ct_expect_hash_rnd, 4);
                nf_ct_expect_hash_rnd_initted = 1;
        }
 
-       return jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
+       hash = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
                      (((tuple->dst.protonum ^ tuple->src.l3num) << 16) |
-                      (__force __u16)tuple->dst.u.all) ^ nf_ct_expect_hash_rnd) %
-              nf_ct_expect_hsize;
+                      (__force __u16)tuple->dst.u.all) ^ nf_ct_expect_hash_rnd);
+       return ((u64)hash * nf_ct_expect_hsize) >> 32;
 }
 
 struct nf_conntrack_expect *
@@ -226,8 +228,8 @@ struct nf_conntrack_expect *nf_ct_expect_alloc(struct nf_conn *me)
 EXPORT_SYMBOL_GPL(nf_ct_expect_alloc);
 
 void nf_ct_expect_init(struct nf_conntrack_expect *exp, int family,
-                      union nf_conntrack_address *saddr,
-                      union nf_conntrack_address *daddr,
+                      union nf_inet_addr *saddr,
+                      union nf_inet_addr *daddr,
                       u_int8_t proto, __be16 *src, __be16 *dst)
 {
        int len;
@@ -425,6 +427,7 @@ static struct hlist_node *ct_expect_get_idx(struct seq_file *seq, loff_t pos)
 }
 
 static void *exp_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(nf_conntrack_lock)
 {
        read_lock_bh(&nf_conntrack_lock);
        return ct_expect_get_idx(seq, *pos);
@@ -437,6 +440,7 @@ static void *exp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 }
 
 static void exp_seq_stop(struct seq_file *seq, void *v)
+       __releases(nf_conntrack_lock)
 {
        read_unlock_bh(&nf_conntrack_lock);
 }