ovpn: propagate socket mark to skb in UDP
Subsystems (2)
PATCH 1/1 ovpn: propagate socket mark to skb in UDP
openvpn implements the --mark option, which utilizes the SO_MARK Linux socket option. However, in the UDP code path, the socket's sk_mark value is not currently propagated to skb objects that pass through our socket.
This commit ensures proper inheritance of the field by assigning sk_mark to skb->mark before handing the skb to the network stack for transmission.
--- drivers/net/ovpn/udp.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ovpn/udp.c +1 -0
@@ -344,6 +344,7 @@ void ovpn_udp_send_skb(struct ovpn_peer *peer, struct sock *sk,int ret; skb->dev = peer->ovpn->dev; + skb->mark =READ_ONCE (sk->sk_mark);/* no checksum performed at this layer */ skb->ip_summed =CHECKSUM_NONE ;
Signature · 1 line
2.49.0
Quoted 10 lines · Ralf Lici
openvpn implements the
--markoption, which utilizes theSO_MARKLinux socket option. However, in the UDP code path, the socket'ssk_markvalue is not currently propagated toskbobjects that pass through our socket.This commit ensures proper inheritance of the field by assigning
sk_marktoskb->markbefore handing theskbto the network stack for transmission.Signed-off-by Ralf Lici <[email protected]...>
Well done!
This patch has been merged to the development branch.
Thanks
Signature · 1 line
Antonio Quartulli