summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 4f8c4e8..069d45d 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -47,6 +47,7 @@ static inline int send4(struct wireguard_device *wg, struct sk_buff *skb, struct
net_dbg_ratelimited("No route to %pISpfsc, error %d\n", addr, ret);
goto err;
} else if (unlikely(rt->dst.dev == skb->dev)) {
+ dst_release(&rt->dst);
ret = -ELOOP;
net_dbg_ratelimited("Avoiding routing loop to %pISpfsc\n", addr);
goto err;
@@ -105,6 +106,7 @@ static inline int send6(struct wireguard_device *wg, struct sk_buff *skb, struct
net_dbg_ratelimited("No route to %pISpfsc, error %d\n", addr, ret);
goto err;
} else if (unlikely(dst->dev == skb->dev)) {
+ dst_release(dst);
ret = -ELOOP;
net_dbg_ratelimited("Avoiding routing loop to %pISpfsc\n", addr);
goto err;