summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-06 12:43:30 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-06 12:43:30 +0100
commit540cbccf3eba6803dd48c5b7cc054e3b7677159f (patch)
tree98920ab9ac24175904b372cac63910e7193c705f
parent9d38dacb2712d05568590ad8691c7b27ee9d4424 (diff)
socket: release dst on routing loop
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-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;