Re: [PATCH] ip_tunnel(ipv4): fix tunnels with "local any remote $remote_ip"
From: Dmitry Popov <hidden>
Date: 2014-07-29 17:49:36
On Mon, 28 Jul 2014 16:39:23 -0700 Cong Wang [off-list ref] wrote:
On Mon, Jul 28, 2014 at 4:07 PM, Dmitry Popov [off-list ref] wrote:quoted
--- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h@@ -40,6 +40,7 @@ struct ip_tunnel_prl_entry { struct ip_tunnel_dst { struct dst_entry __rcu *dst; + __be32 saddr; };It looks odd to save a source address in some struct named dst, maybe it's the time to rename it.
Yes, maybe a bit odd, but ip_tunnel_flow/ip_tunnel_route doesn't look much better for me, so I decided to keep it with old name. David is ok with this name too.
quoted
if (dst) { - if (dst->obsolete && dst->ops->check(dst, cookie) == NULL) { + if (!dst->obsolete || dst->ops->check(dst, cookie)) { + *saddr = idst->saddr; + } else {I am wondering if this always works, that is, if saddr could be still valid as long as dst is valid?
Right, this is not a very smooth place, but a) it should work with current ipv4 route implementation (it obsoletes all dst_entries on any route/addr change). Yes, we shouldn't rely on implementation, but b) I don't know how (and why) this implementation should be changed to break it. I think the assumption that dst_entry is obsoleted when saddr is changed is pretty natural. Please correct me if I'm wrong.