aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2010-08-02 18:07:58 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-02 18:07:58 -0400
commit83bf2e4089bebc2c7fd14a79de5954b26fe8d4af (patch)
treeab2cb1f229ba4c2d7236406c997e41a223daf74d /net/ipv6
parentde38483010bae523f533bb6bf9f7b7353772f6eb (diff)
parent6661481d5a8975657742c7ed40ae16bdaa7d0a6e (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/netfilter/ip6_tables.c14
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c9
2 files changed, 16 insertions, 7 deletions
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index dc41d6d3c6c..5359ef4daac 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -387,9 +387,7 @@ ip6t_do_table(struct sk_buff *skb,
387 goto no_match; 387 goto no_match;
388 } 388 }
389 389
390 ADD_COUNTER(e->counters, 390 ADD_COUNTER(e->counters, skb->len, 1);
391 ntohs(ipv6_hdr(skb)->payload_len) +
392 sizeof(struct ipv6hdr), 1);
393 391
394 t = ip6t_get_target_c(e); 392 t = ip6t_get_target_c(e);
395 IP_NF_ASSERT(t->u.kernel.target); 393 IP_NF_ASSERT(t->u.kernel.target);
@@ -899,7 +897,7 @@ get_counters(const struct xt_table_info *t,
899 struct ip6t_entry *iter; 897 struct ip6t_entry *iter;
900 unsigned int cpu; 898 unsigned int cpu;
901 unsigned int i; 899 unsigned int i;
902 unsigned int curcpu; 900 unsigned int curcpu = get_cpu();
903 901
904 /* Instead of clearing (by a previous call to memset()) 902 /* Instead of clearing (by a previous call to memset())
905 * the counters and using adds, we set the counters 903 * the counters and using adds, we set the counters
@@ -909,14 +907,16 @@ get_counters(const struct xt_table_info *t,
909 * if new softirq were to run and call ipt_do_table 907 * if new softirq were to run and call ipt_do_table
910 */ 908 */
911 local_bh_disable(); 909 local_bh_disable();
912 curcpu = smp_processor_id();
913
914 i = 0; 910 i = 0;
915 xt_entry_foreach(iter, t->entries[curcpu], t->size) { 911 xt_entry_foreach(iter, t->entries[curcpu], t->size) {
916 SET_COUNTER(counters[i], iter->counters.bcnt, 912 SET_COUNTER(counters[i], iter->counters.bcnt,
917 iter->counters.pcnt); 913 iter->counters.pcnt);
918 ++i; 914 ++i;
919 } 915 }
916 local_bh_enable();
917 /* Processing counters from other cpus, we can let bottom half enabled,
918 * (preemption is disabled)
919 */
920 920
921 for_each_possible_cpu(cpu) { 921 for_each_possible_cpu(cpu) {
922 if (cpu == curcpu) 922 if (cpu == curcpu)
@@ -930,7 +930,7 @@ get_counters(const struct xt_table_info *t,
930 } 930 }
931 xt_info_wrunlock(cpu); 931 xt_info_wrunlock(cpu);
932 } 932 }
933 local_bh_enable(); 933 put_cpu();
934} 934}
935 935
936static struct xt_counters *alloc_counters(const struct xt_table *table) 936static struct xt_counters *alloc_counters(const struct xt_table *table)
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 9254008602d..098a050a20b 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -269,6 +269,11 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
269 * in the chain of fragments so far. We must know where to put 269 * in the chain of fragments so far. We must know where to put
270 * this fragment, right? 270 * this fragment, right?
271 */ 271 */
272 prev = fq->q.fragments_tail;
273 if (!prev || NFCT_FRAG6_CB(prev)->offset < offset) {
274 next = NULL;
275 goto found;
276 }
272 prev = NULL; 277 prev = NULL;
273 for (next = fq->q.fragments; next != NULL; next = next->next) { 278 for (next = fq->q.fragments; next != NULL; next = next->next) {
274 if (NFCT_FRAG6_CB(next)->offset >= offset) 279 if (NFCT_FRAG6_CB(next)->offset >= offset)
@@ -276,6 +281,7 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
276 prev = next; 281 prev = next;
277 } 282 }
278 283
284found:
279 /* We found where to put this one. Check for overlap with 285 /* We found where to put this one. Check for overlap with
280 * preceding fragment, and, if needed, align things so that 286 * preceding fragment, and, if needed, align things so that
281 * any overlaps are eliminated. 287 * any overlaps are eliminated.
@@ -341,6 +347,8 @@ static int nf_ct_frag6_queue(struct nf_ct_frag6_queue *fq, struct sk_buff *skb,
341 347
342 /* Insert this fragment in the chain of fragments. */ 348 /* Insert this fragment in the chain of fragments. */
343 skb->next = next; 349 skb->next = next;
350 if (!next)
351 fq->q.fragments_tail = skb;
344 if (prev) 352 if (prev)
345 prev->next = skb; 353 prev->next = skb;
346 else 354 else
@@ -464,6 +472,7 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev)
464 head->csum); 472 head->csum);
465 473
466 fq->q.fragments = NULL; 474 fq->q.fragments = NULL;
475 fq->q.fragments_tail = NULL;
467 476
468 /* all original skbs are linked into the NFCT_FRAG6_CB(head).orig */ 477 /* all original skbs are linked into the NFCT_FRAG6_CB(head).orig */
469 fp = skb_shinfo(head)->frag_list; 478 fp = skb_shinfo(head)->frag_list;