]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ipv6: Set FLOWI_FLAG_KNOWN_NH at flowi6_flags
authorMartin KaFai Lau <kafai@fb.com>
Sat, 23 May 2015 03:56:02 +0000 (20:56 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Sun, 28 May 2017 02:44:17 +0000 (19:44 -0700)
commit2c953266085f86bbe906309a97bd24e1f1b80610
tree4347e8f024227c5a2e7298048c1a5e5bd66a15c1
parentf1e56e7bd290c3899ffe7b7fbd59a1753cb9d9b2
ipv6: Set FLOWI_FLAG_KNOWN_NH at flowi6_flags

The neighbor look-up used to depend on the rt6i_gateway (if
there is a gateway) or the rt6i_dst (if it is a RTF_CACHE clone)
as the nexthop address.  Note that rt6i_dst is set to fl6->daddr
for the RTF_CACHE clone where fl6->daddr is the one used to do
the route look-up.

Now, we only create RTF_CACHE clone after encountering exception.
When doing the neighbor look-up with a route that is neither a gateway
nor a RTF_CACHE clone, the daddr in skb will be used as the nexthop.

In some cases, the daddr in skb is not the one used to do
the route look-up.  One example is in ip_vs_dr_xmit_v6() where the
real nexthop server address is different from the one in the skb.

This patch is going to follow the IPv4 approach and ask the
ip6_pol_route() callers to set the FLOWI_FLAG_KNOWN_NH properly.

In the next patch, ip6_pol_route() will honor the FLOWI_FLAG_KNOWN_NH
and create a RTF_CACHE clone.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Tested-by: Julian Anastasov <ja@ssi.bg>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 48e8aa6e3137692d38f20e8bfff100e408c6bc53)

Orabug: 24694570

Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
net/ipv6/raw.c
net/netfilter/ipvs/ip_vs_xmit.c
net/netfilter/xt_TEE.c