netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net] ipv4: fib: check forwarding before checking send_redirects
@ 2014-04-08 19:31 Cong Wang
  2014-04-08 20:43 ` David Miller
  2014-04-08 22:03 ` Julian Anastasov
  0 siblings, 2 replies; 15+ messages in thread
From: Cong Wang @ 2014-04-08 19:31 UTC (permalink / raw)
  To: netdev; +Cc: davem, Eric Biederman, Julian Anastasov, Cong Wang, Cong Wang

From: Cong Wang <cwang@twopensource.com>

We have seen in a weird case we had to disable send_redirects in order
to pass rp filter check even though we don't set forwarding at all.
This looks wrong, at least according to ip-sysctl.txt send_redirects should
only make sense when we enable forwarding.

Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>

---
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 1a629f8..3f9e324 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -321,7 +321,8 @@ int fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
 	int r = secpath_exists(skb) ? 0 : IN_DEV_RPFILTER(idev);
 
 	if (!r && !fib_num_tclassid_users(dev_net(dev)) &&
-	    (dev->ifindex != oif || !IN_DEV_TX_REDIRECTS(idev))) {
+	    (dev->ifindex != oif || !IN_DEV_FORWARD(idev) ||
+	     !IN_DEV_TX_REDIRECTS(idev))) {
 		*itag = 0;
 		return 0;
 	}

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-04-14 22:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-08 19:31 [Patch net] ipv4: fib: check forwarding before checking send_redirects Cong Wang
2014-04-08 20:43 ` David Miller
2014-04-08 21:17   ` Cong Wang
2014-04-08 21:23     ` David Miller
2014-04-08 21:50       ` Cong Wang
2014-04-08 22:04         ` David Miller
2014-04-08 22:15         ` Julian Anastasov
2014-04-08 22:55           ` Cong Wang
2014-04-09  8:03             ` Julian Anastasov
2014-04-11 19:11               ` Cong Wang
2014-04-12  5:32                 ` Rex Ge
2014-04-13 14:57                 ` Julian Anastasov
2014-04-14 22:59                   ` Cong Wang
2014-04-12  9:52             ` Rex Ge
2014-04-08 22:03 ` Julian Anastasov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).