linux/drivers/net/ipvlan
Cambda Zhu b83927b956 ipvlan: Fix return value of ipvlan_queue_xmit()
[ Upstream commit 8a9922e7be ]

ipvlan_queue_xmit() should return NET_XMIT_XXX, but
ipvlan_xmit_mode_l2/l3() returns rx_handler_result_t or NET_RX_XXX
in some cases. ipvlan_rcv_frame() will only return RX_HANDLER_CONSUMED
in ipvlan_xmit_mode_l2/l3() because 'local' is true. It's equal to
NET_XMIT_SUCCESS. But dev_forward_skb() can return NET_RX_SUCCESS or
NET_RX_DROP, and returning NET_RX_DROP(NET_XMIT_DROP) will increase
both ipvlan and ipvlan->phy_dev drops counter.

The skb to forward can be treated as xmitted successfully. This patch
makes ipvlan_queue_xmit() return NET_XMIT_SUCCESS for forward skb.

Fixes: 2ad7bf3638 ("ipvlan: Initial check-in of the IPVLAN driver.")
Signed-off-by: Cambda Zhu <cambda@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230626093347.7492-1-cambda@linux.alibaba.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2023-07-19 16:35:37 +02:00
..
ipvlan.h ipvlan: hold lower dev to avoid possible use-after-free 2022-11-18 10:39:22 +00:00
ipvlan_core.c ipvlan: Fix return value of ipvlan_queue_xmit() 2023-07-19 16:35:37 +02:00
ipvlan_l3s.c ipvlan: fix bound dev checking for IPv6 l3s mode 2023-06-12 09:34:01 +01:00
ipvlan_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-11-29 13:04:52 -08:00
ipvtap.c drivers: remove struct module * setting from struct class 2023-03-17 15:16:27 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00