ovpn: fix ndo_start_xmit return value on error
Subsystems (2)
PATCH 1/1 ovpn: fix ndo_start_xmit return value on error
From: Antonio Quartulli <[email protected]...>
ndo_start_xmit is basically expected to always return NETDEV_TX_OK. However, in case of error, it was currently returning NET_XMIT_DROP, which is not a valid netdev_tx_t return value, leading to misinterpretation.
Change ndo_start_xmit to always return NETDEV_TX_OK to signal back to the caller that the packet was handled (even if dropped).
Effects of this bug can be seen when sending IPv6 packets having no peer to forward them to:
$ ip netns exec ovpn-server oping -c20 fd00:abcd:220:201::1 PING fd00:abcd:220:201::1 (fd00:abcd:220:201::1) 56 bytes of data.00:abcd:220:201 :1 ping_send failed: No buffer space available ping_sendto: No buffer space available ping_send failed: No buffer space available ping_sendto: No buffer space available ...
--- drivers/net/ovpn/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ovpn/io.c +1 -1
@@ -408,7 +408,7 @@ netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev)dev_dstats_tx_dropped (ovpn->dev);skb_tx_error (skb);kfree_skb_list (skb); -return NET_XMIT_DROP ; +return NETDEV_TX_OK ; }/**
Signature · 1 line
2.49.0
Hi,
Quoted 32 lines · Antonio Quartulli
From: Antonio Quartulli <[email protected]...>
ndo_start_xmitis basically expected to always returnNETDEV_TX_OK. However, in case of error, it was currently returningNET_XMIT_DROP, which is not a validnetdev_tx_treturn value, leading to misinterpretation.Change
ndo_start_xmitto always returnNETDEV_TX_OKto signal back to the caller that the packet was handled (even if dropped).Effects of this bug can be seen when sending IPv6 packets having no peer to forward them to:
$ ip netns exec ovpn-server oping -c20 fd00:abcd:220:201::1 PING fd00:abcd:220:201::1 (fd00:abcd:220:201::1) 56 bytes of data.00:abcd:220:201 :1 ping_send failed: No buffer space available ping_sendto: No buffer space available ping_send failed: No buffer space available ping_sendto: No buffer space available ...Fixes c2d950c4672a ("ovpn: add basic interface creation/destruction/management routines")Signed-off-by Antonio Quartulli <[email protected]...>--- drivers/net/ovpn/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ovpn/io.c +0
-0
drivers/net/ovpn/io.c netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev) · line 412
Quoted 6 lines
drivers/net/ovpn/io.c +1
-1@@ -408,7 +408,7 @@ netdev_tx_t ovpn_net_xmit(struct sk_buff *skb, struct net_device *dev)dev_dstats_tx_dropped (ovpn->dev);skb_tx_error (skb);kfree_skb_list (skb); -return NET_XMIT_DROP ; +return NETDEV_TX_OK ; }
Tested, works :-) - so the previous behaviour was "oping was hanging due to 'out of buffer space' error not being counted as 'packet sent'" and now it's behaving as any regular network interface when there is no ARP/IPv6 ND for that neighbour. Explanation makes sense, too :-)
So
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...Hi,
Quoted 8 lines · Gert Doering
Tested, works :-) - so the previous behaviour was "oping was hanging due to 'out of buffer space' error not being counted as 'packet sent'" and now it's behaving as any regular network interface when there is no ARP/IPv6 ND for that neighbour. Explanation makes sense, too :-)
So
Acked-by Gert Doering <[email protected]...>
Antonio says if I test this, I should state so...
here we go :-)
gert
Signature · 6 lines
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]...Antonio Quartulli
AppliedQuoted 10 lines · Gert Doering
Hi,
Quoted 7 lines · Gert Doering
Tested, works :-) - so the previous behaviour was "oping was hanging due to 'out of buffer space' error not being counted as 'packet sent'" and now it's behaving as any regular network interface when there is no ARP/IPv6 ND for that neighbour. Explanation makes sense, too :-)
So
Quoted 8 lines
Quoted 1 line
Acked-by Gert Doering <[email protected]...>Antonio says if I test this, I should state so...
Tested-by Gert Doering <[email protected]...>Acked-by Gert Doering <[email protected]...>here we go :-)
Merged to main branch, commit id 2176a2102216
Thanks!
Signature · 1 line
Antonio Quartulli