netfilter: nf_nat: fix oops when unloading protocol modules
[linux-2.6-block.git] / net / netfilter / nf_conntrack_core.c
index dcb27910ab3c8f09ff8b392c943a1194c41d6ddc..0f241be28f9eec697ea9216c096657ace6eaefd6 100644 (file)
@@ -1224,6 +1224,8 @@ get_next_corpse(struct net *net, int (*iter)(struct nf_conn *i, void *data),
        spin_lock_bh(&nf_conntrack_lock);
        for (; *bucket < net->ct.htable_size; (*bucket)++) {
                hlist_nulls_for_each_entry(h, n, &net->ct.hash[*bucket], hnnode) {
+                       if (NF_CT_DIRECTION(h) != IP_CT_DIR_ORIGINAL)
+                               continue;
                        ct = nf_ct_tuplehash_to_ctrack(h);
                        if (iter(ct, data))
                                goto found;