Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5506b54b36f067b9776935085c9f8e607b026b23
Commit:     5506b54b36f067b9776935085c9f8e607b026b23
Parent:     704aed53b4e43bebfbd425cf95b66794a9cfa2c2
Author:     Mitsuru Chinen <[EMAIL PROTECTED]>
AuthorDate: Mon Apr 30 00:48:10 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Apr 30 00:58:29 2007 -0700

    [IPV4] SNMP: Support InMcastPkts and InBcastPkts
    
    A received IP multicast datagram should be counted as InMcastPkts.
    By the same token, a received IP broadcast datagram should be
    counted as InBcastPkts.
    
    Signed-off-by: Mitsuru Chinen <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/ip_input.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index c8c455d..9706939 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -329,6 +329,7 @@ drop:
 static inline int ip_rcv_finish(struct sk_buff *skb)
 {
        const struct iphdr *iph = ip_hdr(skb);
+       struct rtable *rt;
 
        /*
         *      Initialise the virtual path cache for the packet. It describes
@@ -360,6 +361,12 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
        if (iph->ihl > 5 && ip_rcv_options(skb))
                goto drop;
 
+       rt = (struct rtable*)skb->dst;
+       if (rt->rt_type == RTN_MULTICAST)
+               IP_INC_STATS_BH(IPSTATS_MIB_INMCASTPKTS);
+       else if (rt->rt_type == RTN_BROADCAST)
+               IP_INC_STATS_BH(IPSTATS_MIB_INBCASTPKTS);
+
        return dst_input(skb);
 
 drop:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to