diff options
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/socket.c b/src/socket.c index 5a77b0c..c46256d 100644 --- a/src/socket.c +++ b/src/socket.c @@ -31,7 +31,7 @@ static int send4(struct wg_device *wg, struct sk_buff *skb, struct sock *sock; int ret = 0; - skb->next = skb->prev = NULL; + skb_mark_not_on_list(skb); skb->dev = wg->dev; skb->mark = wg->fwmark; @@ -86,6 +86,8 @@ static int send4(struct wg_device *wg, struct sk_buff *skb, if (cache) dst_cache_set_ip4(cache, &rt->dst, fl.saddr); } + + skb->ignore_df = 1; udp_tunnel_xmit_skb(rt, sock, skb, fl.saddr, fl.daddr, ds, ip4_dst_hoplimit(&rt->dst), 0, fl.fl4_sport, fl.fl4_dport, false, false); @@ -115,7 +117,7 @@ static int send6(struct wg_device *wg, struct sk_buff *skb, struct sock *sock; int ret = 0; - skb->next = skb->prev = NULL; + skb_mark_not_on_list(skb); skb->dev = wg->dev; skb->mark = wg->fwmark; @@ -140,9 +142,10 @@ static int send6(struct wg_device *wg, struct sk_buff *skb, if (cache) dst_cache_reset(cache); } - ret = ipv6_stub->ipv6_dst_lookup(sock_net(sock), sock, &dst, - &fl); - if (unlikely(ret)) { + dst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(sock), sock, &fl, + NULL); + if (unlikely(IS_ERR(dst))) { + ret = PTR_ERR(dst); net_dbg_ratelimited("%s: No route to %pISpfsc, error %d\n", wg->dev->name, &endpoint->addr, ret); goto err; @@ -157,6 +160,7 @@ static int send6(struct wg_device *wg, struct sk_buff *skb, dst_cache_set_ip6(cache, dst, &fl.saddr); } + skb->ignore_df = 1; udp_tunnel6_xmit_skb(dst, sock, skb, skb->dev, &fl.saddr, &fl.daddr, ds, ip6_dst_hoplimit(dst), 0, fl.fl6_sport, fl.fl6_dport, false); @@ -407,7 +411,7 @@ retry: } #endif - wg_socket_reinit(wg, new4 ? new4->sk : NULL, new6 ? new6->sk : NULL); + wg_socket_reinit(wg, new4->sk, new6 ? new6->sk : NULL); return 0; } |