]> git.itanic.dy.fi Git - linux-stable/commit
ipvlan: fix bound dev checking for IPv6 l3s mode
authorHangbin Liu <liuhangbin@gmail.com>
Fri, 9 Jun 2023 09:15:02 +0000 (17:15 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 12 Jun 2023 08:34:01 +0000 (09:34 +0100)
commitce57adc222aba32431c42632b396e9213d0eb0b8
tree8b26c6223eecfe3acbb88c12b53e3845f6cca40b
parent52f79609c0c5b25fddb88e85f25ce08aa7e3fb42
ipvlan: fix bound dev checking for IPv6 l3s mode

The commit 59a0b022aa24 ("ipvlan: Make skb->skb_iif track skb->dev for l3s
mode") fixed ipvlan bonded dev checking by updating skb skb_iif. This fix
works for IPv4, as in raw_v4_input() the dif is from inet_iif(skb), which
is skb->skb_iif when there is no route.

But for IPv6, the fix is not enough, because in ipv6_raw_deliver() ->
raw_v6_match(), the dif is inet6_iif(skb), which is returns IP6CB(skb)->iif
instead of skb->skb_iif if it's not a l3_slave. To fix the IPv6 part
issue. Let's set IP6CB(skb)->iif to correct ifindex.

BTW, ipvlan handles NS/NA specifically. Since it works fine, I will not
reset IP6CB(skb)->iif when addr->atype is IPVL_ICMPV6.

Fixes: c675e06a98a4 ("ipvlan: decouple l3s mode dependencies from other modes")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=2196710
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Larysa Zaremba <larysa.zaremba@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipvlan/ipvlan_l3s.c