diff options
author | Dietmar Eggemann <dietmar.eggemann@gmx.de> | 2005-06-28 16:06:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-06-28 16:06:23 -0400 |
commit | 2c2910a401f1ce2ac9136171e7522e731e1a2a8c (patch) | |
tree | f7d9bc402481b402539f598cfa20646ec7561efe /net/ipv4/route.c | |
parent | ae9cda5d65f3d8a495241cbdcc2d56f721c83cc3 (diff) |
[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/route.c')
-rw-r--r-- | net/ipv4/route.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 80cf633d9f4a..12a1cf306f67 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1909,7 +1909,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr, | |||
1909 | */ | 1909 | */ |
1910 | if ((err = fib_lookup(&fl, &res)) != 0) { | 1910 | if ((err = fib_lookup(&fl, &res)) != 0) { |
1911 | if (!IN_DEV_FORWARD(in_dev)) | 1911 | if (!IN_DEV_FORWARD(in_dev)) |
1912 | goto e_inval; | 1912 | goto e_hostunreach; |
1913 | goto no_route; | 1913 | goto no_route; |
1914 | } | 1914 | } |
1915 | free_res = 1; | 1915 | free_res = 1; |
@@ -1933,7 +1933,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr, | |||
1933 | } | 1933 | } |
1934 | 1934 | ||
1935 | if (!IN_DEV_FORWARD(in_dev)) | 1935 | if (!IN_DEV_FORWARD(in_dev)) |
1936 | goto e_inval; | 1936 | goto e_hostunreach; |
1937 | if (res.type != RTN_UNICAST) | 1937 | if (res.type != RTN_UNICAST) |
1938 | goto martian_destination; | 1938 | goto martian_destination; |
1939 | 1939 | ||
@@ -2025,6 +2025,11 @@ martian_destination: | |||
2025 | "%u.%u.%u.%u, dev %s\n", | 2025 | "%u.%u.%u.%u, dev %s\n", |
2026 | NIPQUAD(daddr), NIPQUAD(saddr), dev->name); | 2026 | NIPQUAD(daddr), NIPQUAD(saddr), dev->name); |
2027 | #endif | 2027 | #endif |
2028 | |||
2029 | e_hostunreach: | ||
2030 | err = -EHOSTUNREACH; | ||
2031 | goto done; | ||
2032 | |||
2028 | e_inval: | 2033 | e_inval: |
2029 | err = -EINVAL; | 2034 | err = -EINVAL; |
2030 | goto done; | 2035 | goto done; |