From: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
To: netdev@vger.kernel.org
Cc: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
Subject: [PATCH 5/6] [IPV4] SNMP: Support OutMcastPkts and OutBcastPkts
Date: Tue, 17 Apr 2007 20:14:18 +0900 [thread overview]
Message-ID: <20070417201418.e6f1a379.mitch@linux.vnet.ibm.com> (raw)
In-Reply-To: <20070417200944.bd82ded2.mitch@linux.vnet.ibm.com>
A transmitted IP multicast datagram should be counted as OutMcastPkts.
By the same token, a transmitted IP broadcast datagram should be
counted as OutBcastPkts.
Signed-off-by: Mitsuru Chinen <mitch@linux.vnet.ibm.com>
---
net/ipv4/ip_output.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 704bc44..4442185 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -160,9 +160,15 @@ EXPORT_SYMBOL_GPL(ip_build_and_send_pkt)
static inline int ip_finish_output2(struct sk_buff *skb)
{
struct dst_entry *dst = skb->dst;
+ struct rtable *rt = (struct rtable *)dst;
struct net_device *dev = dst->dev;
int hh_len = LL_RESERVED_SPACE(dev);
+ if (rt->rt_type == RTN_MULTICAST)
+ IP_INC_STATS(IPSTATS_MIB_OUTMCASTPKTS);
+ else if (rt->rt_type == RTN_BROADCAST)
+ IP_INC_STATS(IPSTATS_MIB_OUTBCASTPKTS);
+
/* Be paranoid, rather than too clever. */
if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
struct sk_buff *skb2;
--
1.4.3.4
next prev parent reply other threads:[~2007-04-17 11:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 11:09 [PATCH 0/6] SNMP: new statistics specified in RFC4293 Mitsuru Chinen
2007-04-17 11:12 ` [PATCH 1/6] SNMP: Add definitions for {In,Out}BcastPkts Mitsuru Chinen
2007-04-30 7:48 ` David Miller
2007-04-17 11:13 ` [PATCH 2/6] [IPV4] SNMP: Support InNoRoutes Mitsuru Chinen
2007-04-30 7:49 ` David Miller
2007-04-17 11:13 ` [PATCH 3/6] [IPV4] SNMP: Support InTruncatedPkts Mitsuru Chinen
2007-04-30 7:49 ` David Miller
2007-04-17 11:13 ` [PATCH 4/6] [IPV4] SNMP: Support InMcastPkts and InBcastPkts Mitsuru Chinen
2007-04-30 7:49 ` David Miller
2007-04-17 11:14 ` Mitsuru Chinen [this message]
2007-04-30 7:49 ` [PATCH 5/6] [IPV4] SNMP: Support OutMcastPkts and OutBcastPkts David Miller
2007-04-17 11:14 ` [PATCH 6/6] [IPV4] SNMP: Display new statistics at /proc/net/snmp Mitsuru Chinen
2007-04-27 7:46 ` Mitsuru Chinen
2007-04-30 7:50 ` David Miller
2007-05-02 1:05 ` Mitsuru Chinen
2007-05-03 10:15 ` David Miller
2007-05-07 11:29 ` Mitsuru Chinen
2007-05-11 16:10 ` Mitsuru Chinen
2007-05-11 16:19 ` YOSHIFUJI Hideaki / 吉藤英明
2007-05-14 10:07 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070417201418.e6f1a379.mitch@linux.vnet.ibm.com \
--to=mitch@linux.vnet.ibm.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.