From dd0ffdb51a4cddaf1d6662079fa91f6f32bd26a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Thu, 10 Dec 2020 14:15:26 +0100 Subject: [PATCH] Add comment to ioa_addr_is_zero --- src/client/ns_turn_ioaddr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/client/ns_turn_ioaddr.c b/src/client/ns_turn_ioaddr.c index 86b96886..c8c0faf9 100644 --- a/src/client/ns_turn_ioaddr.c +++ b/src/client/ns_turn_ioaddr.c @@ -496,6 +496,12 @@ int ioa_addr_is_loopback(ioa_addr *addr) return 0; } +/* +To avoid a vulnerability this function checks whether the addr is in 0.0.0.0/8 or ::/128. +Source from (INADDR_ANY) 0.0.0.0/32 and (in6addr_any) ::/128 routed to loopback on Linux systems for old BSD backward compatibility. +https://github.com/torvalds/linux/blob/a2f5ea9e314ba6778f885c805c921e9362ec0420/net/ipv6/tcp_ipv6.c#L182 +To avoid any trouble we match the whole 0.0.0.0/8 that defined in RFC6890 as local network "this". +*/ int ioa_addr_is_zero(ioa_addr *addr) { if(addr) {