summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-10-11 00:32:45 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-10-11 15:50:29 +0200
commit8f03a5a22c3de97473a562a7cfe76c6fde674b0e (patch)
tree522ab2d856f80c78fa2a0e7124a8a42bae365c1d /src
parent6a52049c687ab632a37377629261d2b1563f5b76 (diff)
socket: set skb->mark in addition to flowi
Otherwise netfilter's ip_route_me_harder doesn't know how to reroute this and we get a nasty loop. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 6139ef5..e3fd053 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -30,6 +30,7 @@ static inline int send4(struct wireguard_device *wg, struct sk_buff *skb, struct
skb->next = skb->prev = NULL;
skb->dev = wg->dev;
+ skb->mark = wg->fwmark;
rcu_read_lock_bh();
sock = rcu_dereference_bh(wg->sock4);
@@ -100,6 +101,7 @@ static inline int send6(struct wireguard_device *wg, struct sk_buff *skb, struct
skb->next = skb->prev = NULL;
skb->dev = wg->dev;
+ skb->mark = wg->fwmark;
rcu_read_lock_bh();
sock = rcu_dereference_bh(wg->sock6);