Skip to content

Commit 4c88cfc

Browse files
ralfliciordex
authored andcommitted
ovpn: propagate socket mark to skb in UDP
OpenVPN allows users to configure a FW mark on sockets used to communicate with other peers. The mark is set by means of the `SO_MARK` Linux socket option. However, in the ovpn UDP code path, the socket's `sk_mark` value is currently ignored and it is not propagated to outgoing `skbs`. This commit ensures proper inheritance of the field by setting `skb->mark` to `sk->sk_mark` before handing the `skb` to the network stack for transmission. Fixes: 08857b5 ("ovpn: implement basic TX path (UDP)") Reviewed-by: Sabrina Dubroca <[email protected]> Signed-off-by: Ralf Lici <[email protected]> Link: https://www.mail-archive.com/[email protected]/msg31877.html Signed-off-by: Antonio Quartulli <[email protected]>
1 parent dae7f9c commit 4c88cfc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/ovpn/udp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ void ovpn_udp_send_skb(struct ovpn_peer *peer, struct sock *sk,
344344
int ret;
345345

346346
skb->dev = peer->ovpn->dev;
347+
skb->mark = READ_ONCE(sk->sk_mark);
347348
/* no checksum performed at this layer */
348349
skb->ip_summed = CHECKSUM_NONE;
349350

0 commit comments

Comments
 (0)