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. Signed-off-by: Ralf Lici <r...@mandelbit.com> --- drivers/net/ovpn/udp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ovpn/udp.c b/drivers/net/ovpn/udp.c index b4fbebad8f45..4f9c9a9a889a 100644 --- a/drivers/net/ovpn/udp.c +++ b/drivers/net/ovpn/udp.c @@ -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; -- 2.49.0 _______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel