Re: [PATCH] ipvlan: fix ipv6 outbound device
From: liuqifa <hidden>
Date: 2017-11-10 00:56:24
That's a good question. Recently, I am researching how to use ipvlan, I found when using L3 mode, the packet from the ipvlan slave interface can only get out from the phy device which the slave interface attached, and I found this is assigning the flowi4's output device result, so I tried to don't assign the output device, I found the packet from the ipvlan slave interface can be forwarded to another phy device, but it has bringing some other problem. At the same time, when I read the code, I found the process of ipv6 packet is different, so I think this is a bug. I am look forward to listening to your advice! --------------------------------------------------------------------------------------------------------------------------- On Thu, Nov 9, 2017 at 9:09 PM, [off-list ref] wrote:
From: Keefe Liu <redacted> When process the outbound packet of ipv6, we should assign the master device to output device other than input device.
curious to know, how you discovered this?
Signed-off-by: Keefe Liu <redacted>
Acked-by: Mahesh Bandewar <redacted>
quoted hunk
--- drivers/net/ipvlan/ipvlan_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/drivers/net/ipvlan/ipvlan_core.cb/drivers/net/ipvlan/ipvlan_core.c index 034ae4c..f2a7e92 100644--- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c@@ -409,7 +409,7 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb) struct dst_entry *dst; int err, ret = NET_XMIT_DROP; struct flowi6 fl6 = { - .flowi6_iif = dev->ifindex, + .flowi6_oif = dev->ifindex, .daddr = ip6h->daddr, .saddr = ip6h->saddr, .flowi6_flags = FLOWI_FLAG_ANYSRC, --1.8.3.1