aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/ip_output.c')
-rw-r--r--net/ipv4/ip_output.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index f003186b93b1..465544f6281a 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -182,9 +182,9 @@ static inline int ip_finish_output2(struct sk_buff *skb)
182 unsigned int hh_len = LL_RESERVED_SPACE(dev); 182 unsigned int hh_len = LL_RESERVED_SPACE(dev);
183 183
184 if (rt->rt_type == RTN_MULTICAST) 184 if (rt->rt_type == RTN_MULTICAST)
185 IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); 185 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_OUTMCASTPKTS);
186 else if (rt->rt_type == RTN_BROADCAST) 186 else if (rt->rt_type == RTN_BROADCAST)
187 IP_INC_STATS(IPSTATS_MIB_OUTBCASTPKTS); 187 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_OUTBCASTPKTS);
188 188
189 /* Be paranoid, rather than too clever. */ 189 /* Be paranoid, rather than too clever. */
190 if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) { 190 if (unlikely(skb_headroom(skb) < hh_len && dev->header_ops)) {
@@ -244,7 +244,7 @@ int ip_mc_output(struct sk_buff *skb)
244 /* 244 /*
245 * If the indicated interface is up and running, send the packet. 245 * If the indicated interface is up and running, send the packet.
246 */ 246 */
247 IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 247 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_OUTREQUESTS);
248 248
249 skb->dev = dev; 249 skb->dev = dev;
250 skb->protocol = htons(ETH_P_IP); 250 skb->protocol = htons(ETH_P_IP);
@@ -298,7 +298,7 @@ int ip_output(struct sk_buff *skb)
298{ 298{
299 struct net_device *dev = skb->dst->dev; 299 struct net_device *dev = skb->dst->dev;
300 300
301 IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 301 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_OUTREQUESTS);
302 302
303 skb->dev = dev; 303 skb->dev = dev;
304 skb->protocol = htons(ETH_P_IP); 304 skb->protocol = htons(ETH_P_IP);
@@ -389,7 +389,7 @@ packet_routed:
389 return ip_local_out(skb); 389 return ip_local_out(skb);
390 390
391no_route: 391no_route:
392 IP_INC_STATS(IPSTATS_MIB_OUTNOROUTES); 392 IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
393 kfree_skb(skb); 393 kfree_skb(skb);
394 return -EHOSTUNREACH; 394 return -EHOSTUNREACH;
395} 395}
@@ -451,7 +451,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
451 iph = ip_hdr(skb); 451 iph = ip_hdr(skb);
452 452
453 if (unlikely((iph->frag_off & htons(IP_DF)) && !skb->local_df)) { 453 if (unlikely((iph->frag_off & htons(IP_DF)) && !skb->local_df)) {
454 IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); 454 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
455 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, 455 icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
456 htonl(ip_skb_dst_mtu(skb))); 456 htonl(ip_skb_dst_mtu(skb)));
457 kfree_skb(skb); 457 kfree_skb(skb);
@@ -542,7 +542,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
542 err = output(skb); 542 err = output(skb);
543 543
544 if (!err) 544 if (!err)
545 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES); 545 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGCREATES);
546 if (err || !frag) 546 if (err || !frag)
547 break; 547 break;
548 548
@@ -552,7 +552,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
552 } 552 }
553 553
554 if (err == 0) { 554 if (err == 0) {
555 IP_INC_STATS(IPSTATS_MIB_FRAGOKS); 555 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGOKS);
556 return 0; 556 return 0;
557 } 557 }
558 558
@@ -561,7 +561,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
561 kfree_skb(frag); 561 kfree_skb(frag);
562 frag = skb; 562 frag = skb;
563 } 563 }
564 IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); 564 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
565 return err; 565 return err;
566 } 566 }
567 567
@@ -673,15 +673,15 @@ slow_path:
673 if (err) 673 if (err)
674 goto fail; 674 goto fail;
675 675
676 IP_INC_STATS(IPSTATS_MIB_FRAGCREATES); 676 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGCREATES);
677 } 677 }
678 kfree_skb(skb); 678 kfree_skb(skb);
679 IP_INC_STATS(IPSTATS_MIB_FRAGOKS); 679 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGOKS);
680 return err; 680 return err;
681 681
682fail: 682fail:
683 kfree_skb(skb); 683 kfree_skb(skb);
684 IP_INC_STATS(IPSTATS_MIB_FRAGFAILS); 684 IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
685 return err; 685 return err;
686} 686}
687 687
@@ -1047,7 +1047,7 @@ alloc_new_skb:
1047 1047
1048error: 1048error:
1049 inet->cork.length -= length; 1049 inet->cork.length -= length;
1050 IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1050 IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
1051 return err; 1051 return err;
1052} 1052}
1053 1053
@@ -1189,7 +1189,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
1189 1189
1190error: 1190error:
1191 inet->cork.length -= size; 1191 inet->cork.length -= size;
1192 IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1192 IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
1193 return err; 1193 return err;
1194} 1194}
1195 1195
@@ -1298,7 +1298,7 @@ out:
1298 return err; 1298 return err;
1299 1299
1300error: 1300error:
1301 IP_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1301 IP_INC_STATS(net, IPSTATS_MIB_OUTDISCARDS);
1302 goto out; 1302 goto out;
1303} 1303}
1304 1304