diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-06-02 08:05:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-03 06:18:19 -0400 |
commit | b5f7e7554753e2cc3ef3bef0271fdb32027df2ba (patch) | |
tree | e7908b1ccf1cfef6bdeb7cac4c83f6d2ad2be54e /net/ipv4/fib_frontend.c | |
parent | 8cbccbe76168a0c627d2274e4a322116804db30f (diff) |
ipv4: add LINUX_MIB_IPRPFILTER snmp counter
Christoph Lameter mentioned that packets could be dropped in input path
because of rp_filter settings, without any SNMP counter being
incremented. System administrator can have a hard time to track the
problem.
This patch introduces a new counter, LINUX_MIB_IPRPFILTER, incremented
each time we drop a packet because Reverse Path Filter triggers.
(We receive an IPv4 datagram on a given interface, and find the route to
send an answer would use another interface)
netstat -s | grep IPReversePathFilter
IPReversePathFilter: 21714
Reported-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 4f0ed458c883..e830f7a123bd 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -284,7 +284,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, | |||
284 | if (no_addr) | 284 | if (no_addr) |
285 | goto last_resort; | 285 | goto last_resort; |
286 | if (rpf == 1) | 286 | if (rpf == 1) |
287 | goto e_inval; | 287 | goto e_rpf; |
288 | fl.oif = dev->ifindex; | 288 | fl.oif = dev->ifindex; |
289 | 289 | ||
290 | ret = 0; | 290 | ret = 0; |
@@ -299,7 +299,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, | |||
299 | 299 | ||
300 | last_resort: | 300 | last_resort: |
301 | if (rpf) | 301 | if (rpf) |
302 | goto e_inval; | 302 | goto e_rpf; |
303 | *spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); | 303 | *spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE); |
304 | *itag = 0; | 304 | *itag = 0; |
305 | return 0; | 305 | return 0; |
@@ -308,6 +308,8 @@ e_inval_res: | |||
308 | fib_res_put(&res); | 308 | fib_res_put(&res); |
309 | e_inval: | 309 | e_inval: |
310 | return -EINVAL; | 310 | return -EINVAL; |
311 | e_rpf: | ||
312 | return -EXDEV; | ||
311 | } | 313 | } |
312 | 314 | ||
313 | static inline __be32 sk_extract_addr(struct sockaddr *addr) | 315 | static inline __be32 sk_extract_addr(struct sockaddr *addr) |