wg-quick: android: do not choke on empty allowed-ips
Reported-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
1aa8364b17
commit
7e106d3a4c
1 changed files with 4 additions and 1 deletions
|
@ -512,8 +512,11 @@ static void set_routes(const char *iface, unsigned int netid)
|
||||||
if (!start)
|
if (!start)
|
||||||
continue;
|
continue;
|
||||||
++start;
|
++start;
|
||||||
for (char *allowedip = strtok(start, " \n"); allowedip; allowedip = strtok(NULL, " \n"))
|
for (char *allowedip = strtok(start, " \n"); allowedip; allowedip = strtok(NULL, " \n")) {
|
||||||
|
if (!strcmp(allowedip, "(none)"))
|
||||||
|
continue;
|
||||||
add_route(iface, netid, allowedip);
|
add_route(iface, netid, allowedip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue