[FS#1358] Wireguard interface and the wrong route to the ip of the peer
LEDE Bugs
lede-bugs at lists.infradead.org
Fri Mar 9 09:49:01 PST 2018
The following task has a new comment added:
FS#1358 - Wireguard interface and the wrong route to the ip of the peer
User who did this - Mikael (mikma)
----------
> Jo-Philipp Wich: I assume you either have duplicate default routes configured or overlapping scopes in your setup.
What does scope mean in this context?
I looked in the source code and it seems to use the least specific route when calculating the source route. I also verified the behaviour by configuring a static route covering the wireguard peer that's more specific than the default route, but netifd ignored that route. The code below in interface-ip.c looks wrong.
static void
__find_ip_route_target(struct interface_ip_settings *ip, union if_addr *a,
bool v6, struct device_route **res)
...
if (!*res || route->mask < (*res)->mask)
*res = route;
Shouldn't it be:
if (!*res || route->mask > (*res)->mask)
*res = route;
----------
More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=1358#comment4444
More information about the lede-bugs
mailing list