Skip to content
Commit 3789caba authored by Shmulik Ladkani's avatar Shmulik Ladkani Committed by David S. Miller
Browse files

ip6_tunnel: collect_md xmit: Use ip_tunnel_key's provided src address

When using an ip6tnl device in collect_md mode, the xmit methods ignore
the ipv6.src field present in skb_tunnel_info's key, both for route
calculation purposes (flowi6 construction) and for assigning the
packet's final ipv6h->saddr.

This makes it impossible specifying a desired ipv6 local address in the
encapsulating header (for example, when using tc action tunnel_key).

This is also not aligned with behavior of ipip (ipv4) in collect_md
mode, where the key->u.ipv4.src gets used.

Fix, by assigning fl6.saddr with given key->u.ipv6.src.
In case ipv6.src is not specified, ip6_tnl_xmit uses existing saddr
selection code.

Fixes: 8d79266b

 ("ip6_tunnel: add collect_md mode to IPv6 tunnels")
Signed-off-by: default avatarShmulik Ladkani <shmulik.ladkani@gmail.com>
Reviewed-by: default avatarEyal Birger <eyal.birger@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ca61630
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment