diff options
author | Dietmar Eggemann <dietmar.eggemann@gmx.de> | 2005-06-28 13:06:23 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-28 13:06:23 -0700 |
commit | 2c2910a401f1ce2ac9136171e7522e731e1a2a8c (patch) | |
tree | f7d9bc402481b402539f598cfa20646ec7561efe /net/ipv4/ip_input.c | |
parent | ae9cda5d65f3d8a495241cbdcc2d56f721c83cc3 (diff) | |
download | kernel_samsung_tuna-2c2910a401f1ce2ac9136171e7522e731e1a2a8c.zip kernel_samsung_tuna-2c2910a401f1ce2ac9136171e7522e731e1a2a8c.tar.gz kernel_samsung_tuna-2c2910a401f1ce2ac9136171e7522e731e1a2a8c.tar.bz2 |
[IPV4]: Snmpv2 Mib IP counter ipInAddrErrors support
I followed Thomas' proposal to see every martian destination as a case
where the ipInAddrErrors counter has to be incremented. There are
two advantages by doing so: (1) The relation between the ipInReceive
counter and all the other ipInXXX counters is more accurate in the
case the RTN_UNICAST code check fails and (2) it makes the code in
ip_route_input_slow easier.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@gmx.de>
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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index af2ec88..c703528 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -283,14 +283,18 @@ static inline int ip_rcv_finish(struct sk_buff *skb) { struct net_device *dev = skb->dev; struct iphdr *iph = skb->nh.iph; + int err; /* * Initialise the virtual path cache for the packet. It describes * how the packet travels inside Linux networking. */ if (skb->dst == NULL) { - if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev)) + if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) { + if (err == -EHOSTUNREACH) + IP_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS); goto drop; + } } #ifdef CONFIG_NET_CLS_ROUTE |