aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/mcast.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2006-11-04 06:11:37 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:22:08 -0500
commita11d206d0f88e092419877c7f706cafb5e1c2e57 (patch)
treeed96428bb52765198d5c5b7ccbc1f1b6516ffb3f /net/ipv6/mcast.c
parent7a3025b1b3a0173be5de6ced18754b909da27b38 (diff)
[IPV6]: Per-interface statistics support.
For IP MIB (RFC4293). Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r--net/ipv6/mcast.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 9055979083b6..c006d02be8bc 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1465,7 +1465,7 @@ static void mld_sendpack(struct sk_buff *skb)
1465 struct inet6_dev *idev = in6_dev_get(skb->dev); 1465 struct inet6_dev *idev = in6_dev_get(skb->dev);
1466 int err; 1466 int err;
1467 1467
1468 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 1468 IP6_INC_STATS(idev, IPSTATS_MIB_OUTREQUESTS);
1469 payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h - 1469 payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
1470 sizeof(struct ipv6hdr); 1470 sizeof(struct ipv6hdr);
1471 mldlen = skb->tail - skb->h.raw; 1471 mldlen = skb->tail - skb->h.raw;
@@ -1477,9 +1477,9 @@ static void mld_sendpack(struct sk_buff *skb)
1477 mld_dev_queue_xmit); 1477 mld_dev_queue_xmit);
1478 if (!err) { 1478 if (!err) {
1479 ICMP6_INC_STATS(idev,ICMP6_MIB_OUTMSGS); 1479 ICMP6_INC_STATS(idev,ICMP6_MIB_OUTMSGS);
1480 IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); 1480 IP6_INC_STATS(idev, IPSTATS_MIB_OUTMCASTPKTS);
1481 } else 1481 } else
1482 IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1482 IP6_INC_STATS(idev, IPSTATS_MIB_OUTDISCARDS);
1483 1483
1484 if (likely(idev != NULL)) 1484 if (likely(idev != NULL))
1485 in6_dev_put(idev); 1485 in6_dev_put(idev);
@@ -1763,7 +1763,10 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1763 IPV6_TLV_ROUTERALERT, 2, 0, 0, 1763 IPV6_TLV_ROUTERALERT, 2, 0, 0,
1764 IPV6_TLV_PADN, 0 }; 1764 IPV6_TLV_PADN, 0 };
1765 1765
1766 IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); 1766 rcu_read_lock();
1767 IP6_INC_STATS(__in6_dev_get(dev),
1768 IPSTATS_MIB_OUTREQUESTS);
1769 rcu_read_unlock();
1767 snd_addr = addr; 1770 snd_addr = addr;
1768 if (type == ICMPV6_MGM_REDUCTION) { 1771 if (type == ICMPV6_MGM_REDUCTION) {
1769 snd_addr = &all_routers; 1772 snd_addr = &all_routers;
@@ -1777,7 +1780,10 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1777 skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err); 1780 skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
1778 1781
1779 if (skb == NULL) { 1782 if (skb == NULL) {
1780 IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1783 rcu_read_lock();
1784 IP6_INC_STATS(__in6_dev_get(dev),
1785 IPSTATS_MIB_OUTDISCARDS);
1786 rcu_read_unlock();
1781 return; 1787 return;
1782 } 1788 }
1783 1789
@@ -1816,9 +1822,9 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1816 else 1822 else
1817 ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBRESPONSES); 1823 ICMP6_INC_STATS(idev, ICMP6_MIB_OUTGROUPMEMBRESPONSES);
1818 ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS); 1824 ICMP6_INC_STATS(idev, ICMP6_MIB_OUTMSGS);
1819 IP6_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS); 1825 IP6_INC_STATS(idev, IPSTATS_MIB_OUTMCASTPKTS);
1820 } else 1826 } else
1821 IP6_INC_STATS(IPSTATS_MIB_OUTDISCARDS); 1827 IP6_INC_STATS(idev, IPSTATS_MIB_OUTDISCARDS);
1822 1828
1823 if (likely(idev != NULL)) 1829 if (likely(idev != NULL))
1824 in6_dev_put(idev); 1830 in6_dev_put(idev);