restund: fix CVE-2021-21382
[feed/telephony.git] / net / restund / patches / 201-turn-also-don-t-forward-linklocal-addresses.patch
1 From e2f4094e23c73d4563a55f0de72244f34bb5b702 Mon Sep 17 00:00:00 2001
2 From: Dusan Stevanovic <dule@wire.com>
3 Date: Thu, 11 Mar 2021 11:53:50 +0100
4 Subject: [PATCH] turn: also don't forward linklocal addresses
5
6 ---
7 modules/turn/turn.c | 4 ++--
8 1 file changed, 2 insertions(+), 2 deletions(-)
9
10 --- a/modules/turn/turn.c
11 +++ b/modules/turn/turn.c
12 @@ -181,7 +181,7 @@ static bool indication_handler(struct re
13 return true;
14 }
15
16 - if (sa_is_loopback(psa) || sa_is_any(psa))
17 + if (sa_is_loopback(psa) || sa_is_any(psa) || sa_is_linklocal(psa))
18 err = EPERM;
19 else
20 err = udp_send(al->rel_us, psa, &data->v.data);
21 @@ -234,7 +234,7 @@ static bool raw_handler(int proto, const
22
23 mb->end = mb->pos + len;
24
25 - if (sa_is_loopback(psa) || sa_is_any(psa))
26 + if (sa_is_loopback(psa) || sa_is_any(psa) || sa_is_linklocal(psa))
27 err = EPERM;
28 else
29 err = udp_send(al->rel_us, psa, mb);