diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-16 23:20:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-16 23:20:11 -0400 |
commit | 7c73a6faffae0bfae70639113aecf06af666e714 (patch) | |
tree | 3d7910c4674b673b061f3168b140454b1950c346 /net/ipv4/ip_fragment.c | |
parent | 5e38e270444f2629de7a706b5a9ca1b333d14517 (diff) |
mib: add net to IP_INC_STATS_BH
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_fragment.c')
-rw-r--r-- | net/ipv4/ip_fragment.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index e23be5b36e1d..65364c06ada5 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c | |||
@@ -199,8 +199,8 @@ static void ip_expire(unsigned long arg) | |||
199 | 199 | ||
200 | ipq_kill(qp); | 200 | ipq_kill(qp); |
201 | 201 | ||
202 | IP_INC_STATS_BH(IPSTATS_MIB_REASMTIMEOUT); | 202 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMTIMEOUT); |
203 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); | 203 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); |
204 | 204 | ||
205 | if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) { | 205 | if ((qp->q.last_in & INET_FRAG_FIRST_IN) && qp->q.fragments != NULL) { |
206 | struct sk_buff *head = qp->q.fragments; | 206 | struct sk_buff *head = qp->q.fragments; |
@@ -261,7 +261,10 @@ static inline int ip_frag_too_far(struct ipq *qp) | |||
261 | rc = qp->q.fragments && (end - start) > max; | 261 | rc = qp->q.fragments && (end - start) > max; |
262 | 262 | ||
263 | if (rc) { | 263 | if (rc) { |
264 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); | 264 | struct net *net; |
265 | |||
266 | net = container_of(qp->q.net, struct net, ipv4.frags); | ||
267 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); | ||
265 | } | 268 | } |
266 | 269 | ||
267 | return rc; | 270 | return rc; |
@@ -545,7 +548,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev, | |||
545 | iph = ip_hdr(head); | 548 | iph = ip_hdr(head); |
546 | iph->frag_off = 0; | 549 | iph->frag_off = 0; |
547 | iph->tot_len = htons(len); | 550 | iph->tot_len = htons(len); |
548 | IP_INC_STATS_BH(IPSTATS_MIB_REASMOKS); | 551 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS); |
549 | qp->q.fragments = NULL; | 552 | qp->q.fragments = NULL; |
550 | return 0; | 553 | return 0; |
551 | 554 | ||
@@ -560,7 +563,7 @@ out_oversize: | |||
560 | "Oversized IP packet from " NIPQUAD_FMT ".\n", | 563 | "Oversized IP packet from " NIPQUAD_FMT ".\n", |
561 | NIPQUAD(qp->saddr)); | 564 | NIPQUAD(qp->saddr)); |
562 | out_fail: | 565 | out_fail: |
563 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); | 566 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMFAILS); |
564 | return err; | 567 | return err; |
565 | } | 568 | } |
566 | 569 | ||
@@ -571,7 +574,7 @@ int ip_defrag(struct sk_buff *skb, u32 user) | |||
571 | struct net *net; | 574 | struct net *net; |
572 | 575 | ||
573 | net = skb->dev ? dev_net(skb->dev) : dev_net(skb->dst->dev); | 576 | net = skb->dev ? dev_net(skb->dev) : dev_net(skb->dst->dev); |
574 | IP_INC_STATS_BH(IPSTATS_MIB_REASMREQDS); | 577 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMREQDS); |
575 | 578 | ||
576 | /* Start by cleaning up the memory. */ | 579 | /* Start by cleaning up the memory. */ |
577 | if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) | 580 | if (atomic_read(&net->ipv4.frags.mem) > net->ipv4.frags.high_thresh) |
@@ -590,7 +593,7 @@ int ip_defrag(struct sk_buff *skb, u32 user) | |||
590 | return ret; | 593 | return ret; |
591 | } | 594 | } |
592 | 595 | ||
593 | IP_INC_STATS_BH(IPSTATS_MIB_REASMFAILS); | 596 | IP_INC_STATS_BH(net, IPSTATS_MIB_REASMFAILS); |
594 | kfree_skb(skb); | 597 | kfree_skb(skb); |
595 | return -ENOMEM; | 598 | return -ENOMEM; |
596 | } | 599 | } |