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_input.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_input.c')
-rw-r--r-- | net/ipv4/ip_input.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 7c26428ea67b..043f640df4b7 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -230,16 +230,16 @@ static int ip_local_deliver_finish(struct sk_buff *skb) | |||
230 | protocol = -ret; | 230 | protocol = -ret; |
231 | goto resubmit; | 231 | goto resubmit; |
232 | } | 232 | } |
233 | IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); | 233 | IP_INC_STATS_BH(net, IPSTATS_MIB_INDELIVERS); |
234 | } else { | 234 | } else { |
235 | if (!raw) { | 235 | if (!raw) { |
236 | if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { | 236 | if (xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { |
237 | IP_INC_STATS_BH(IPSTATS_MIB_INUNKNOWNPROTOS); | 237 | IP_INC_STATS_BH(net, IPSTATS_MIB_INUNKNOWNPROTOS); |
238 | icmp_send(skb, ICMP_DEST_UNREACH, | 238 | icmp_send(skb, ICMP_DEST_UNREACH, |
239 | ICMP_PROT_UNREACH, 0); | 239 | ICMP_PROT_UNREACH, 0); |
240 | } | 240 | } |
241 | } else | 241 | } else |
242 | IP_INC_STATS_BH(IPSTATS_MIB_INDELIVERS); | 242 | IP_INC_STATS_BH(net, IPSTATS_MIB_INDELIVERS); |
243 | kfree_skb(skb); | 243 | kfree_skb(skb); |
244 | } | 244 | } |
245 | } | 245 | } |
@@ -281,7 +281,7 @@ static inline int ip_rcv_options(struct sk_buff *skb) | |||
281 | --ANK (980813) | 281 | --ANK (980813) |
282 | */ | 282 | */ |
283 | if (skb_cow(skb, skb_headroom(skb))) { | 283 | if (skb_cow(skb, skb_headroom(skb))) { |
284 | IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); | 284 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INDISCARDS); |
285 | goto drop; | 285 | goto drop; |
286 | } | 286 | } |
287 | 287 | ||
@@ -290,7 +290,7 @@ static inline int ip_rcv_options(struct sk_buff *skb) | |||
290 | opt->optlen = iph->ihl*4 - sizeof(struct iphdr); | 290 | opt->optlen = iph->ihl*4 - sizeof(struct iphdr); |
291 | 291 | ||
292 | if (ip_options_compile(dev_net(dev), opt, skb)) { | 292 | if (ip_options_compile(dev_net(dev), opt, skb)) { |
293 | IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); | 293 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INHDRERRORS); |
294 | goto drop; | 294 | goto drop; |
295 | } | 295 | } |
296 | 296 | ||
@@ -334,9 +334,11 @@ static int ip_rcv_finish(struct sk_buff *skb) | |||
334 | skb->dev); | 334 | skb->dev); |
335 | if (unlikely(err)) { | 335 | if (unlikely(err)) { |
336 | if (err == -EHOSTUNREACH) | 336 | if (err == -EHOSTUNREACH) |
337 | IP_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS); | 337 | IP_INC_STATS_BH(dev_net(skb->dev), |
338 | IPSTATS_MIB_INADDRERRORS); | ||
338 | else if (err == -ENETUNREACH) | 339 | else if (err == -ENETUNREACH) |
339 | IP_INC_STATS_BH(IPSTATS_MIB_INNOROUTES); | 340 | IP_INC_STATS_BH(dev_net(skb->dev), |
341 | IPSTATS_MIB_INNOROUTES); | ||
340 | goto drop; | 342 | goto drop; |
341 | } | 343 | } |
342 | } | 344 | } |
@@ -357,9 +359,9 @@ static int ip_rcv_finish(struct sk_buff *skb) | |||
357 | 359 | ||
358 | rt = skb->rtable; | 360 | rt = skb->rtable; |
359 | if (rt->rt_type == RTN_MULTICAST) | 361 | if (rt->rt_type == RTN_MULTICAST) |
360 | IP_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS); | 362 | IP_INC_STATS_BH(dev_net(rt->u.dst.dev), IPSTATS_MIB_INMCASTPKTS); |
361 | else if (rt->rt_type == RTN_BROADCAST) | 363 | else if (rt->rt_type == RTN_BROADCAST) |
362 | IP_INC_STATS_BH(IPSTATS_MIB_INBCASTPKTS); | 364 | IP_INC_STATS_BH(dev_net(rt->u.dst.dev), IPSTATS_MIB_INBCASTPKTS); |
363 | 365 | ||
364 | return dst_input(skb); | 366 | return dst_input(skb); |
365 | 367 | ||
@@ -382,10 +384,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
382 | if (skb->pkt_type == PACKET_OTHERHOST) | 384 | if (skb->pkt_type == PACKET_OTHERHOST) |
383 | goto drop; | 385 | goto drop; |
384 | 386 | ||
385 | IP_INC_STATS_BH(IPSTATS_MIB_INRECEIVES); | 387 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INRECEIVES); |
386 | 388 | ||
387 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { | 389 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) { |
388 | IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); | 390 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INDISCARDS); |
389 | goto out; | 391 | goto out; |
390 | } | 392 | } |
391 | 393 | ||
@@ -418,7 +420,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
418 | 420 | ||
419 | len = ntohs(iph->tot_len); | 421 | len = ntohs(iph->tot_len); |
420 | if (skb->len < len) { | 422 | if (skb->len < len) { |
421 | IP_INC_STATS_BH(IPSTATS_MIB_INTRUNCATEDPKTS); | 423 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INTRUNCATEDPKTS); |
422 | goto drop; | 424 | goto drop; |
423 | } else if (len < (iph->ihl*4)) | 425 | } else if (len < (iph->ihl*4)) |
424 | goto inhdr_error; | 426 | goto inhdr_error; |
@@ -428,7 +430,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
428 | * Note this now means skb->len holds ntohs(iph->tot_len). | 430 | * Note this now means skb->len holds ntohs(iph->tot_len). |
429 | */ | 431 | */ |
430 | if (pskb_trim_rcsum(skb, len)) { | 432 | if (pskb_trim_rcsum(skb, len)) { |
431 | IP_INC_STATS_BH(IPSTATS_MIB_INDISCARDS); | 433 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INDISCARDS); |
432 | goto drop; | 434 | goto drop; |
433 | } | 435 | } |
434 | 436 | ||
@@ -439,7 +441,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
439 | ip_rcv_finish); | 441 | ip_rcv_finish); |
440 | 442 | ||
441 | inhdr_error: | 443 | inhdr_error: |
442 | IP_INC_STATS_BH(IPSTATS_MIB_INHDRERRORS); | 444 | IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_INHDRERRORS); |
443 | drop: | 445 | drop: |
444 | kfree_skb(skb); | 446 | kfree_skb(skb); |
445 | out: | 447 | out: |