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>
This commit is contained in:

committed by
David S. Miller

parent
8cbccbe761
commit
b5f7e75547
@@ -284,7 +284,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
|
||||
if (no_addr)
|
||||
goto last_resort;
|
||||
if (rpf == 1)
|
||||
goto e_inval;
|
||||
goto e_rpf;
|
||||
fl.oif = dev->ifindex;
|
||||
|
||||
ret = 0;
|
||||
@@ -299,7 +299,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif,
|
||||
|
||||
last_resort:
|
||||
if (rpf)
|
||||
goto e_inval;
|
||||
goto e_rpf;
|
||||
*spec_dst = inet_select_addr(dev, 0, RT_SCOPE_UNIVERSE);
|
||||
*itag = 0;
|
||||
return 0;
|
||||
@@ -308,6 +308,8 @@ e_inval_res:
|
||||
fib_res_put(&res);
|
||||
e_inval:
|
||||
return -EINVAL;
|
||||
e_rpf:
|
||||
return -EXDEV;
|
||||
}
|
||||
|
||||
static inline __be32 sk_extract_addr(struct sockaddr *addr)
|
||||
|
Reference in New Issue
Block a user