Patch "ipvlan: fix bound dev checking for IPv6 l3s mode" has been added to the 6.3-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ipvlan: fix bound dev checking for IPv6 l3s mode

to the 6.3-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipvlan-fix-bound-dev-checking-for-ipv6-l3s-mode.patch
and it can be found in the queue-6.3 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit dc9d7db01a36033a01a82c8bf575444f81d4c195
Author: Hangbin Liu <liuhangbin@xxxxxxxxx>
Date:   Fri Jun 9 17:15:02 2023 +0800

    ipvlan: fix bound dev checking for IPv6 l3s mode
    
    [ Upstream commit ce57adc222aba32431c42632b396e9213d0eb0b8 ]
    
    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@xxxxxxxxx>
    Reviewed-by: Larysa Zaremba <larysa.zaremba@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ipvlan/ipvlan_l3s.c b/drivers/net/ipvlan/ipvlan_l3s.c
index 71712ea25403d..d5b05e8032199 100644
--- a/drivers/net/ipvlan/ipvlan_l3s.c
+++ b/drivers/net/ipvlan/ipvlan_l3s.c
@@ -102,6 +102,10 @@ static unsigned int ipvlan_nf_input(void *priv, struct sk_buff *skb,
 
 	skb->dev = addr->master->dev;
 	skb->skb_iif = skb->dev->ifindex;
+#if IS_ENABLED(CONFIG_IPV6)
+	if (addr->atype == IPVL_IPV6)
+		IP6CB(skb)->iif = skb->dev->ifindex;
+#endif
 	len = skb->len + ETH_HLEN;
 	ipvlan_count_rx(addr->master, len, true, false);
 out:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux