Re: Netifd proto_add_host_dependency (called by wireguard) replacing unreachable route

2021-10-25 Thread Luiz Angelo Daros de Luca
> I think that netifd really wanted to add a dependency to the first
> route, not the second one.
> Maybe netifd should ignore those routes with types for host
> dependencies, but I don't know  the consequences of that change.

Or maybe it is ok to monitor those kinds of routes if their type is preserved
and it netifd consider metrics when it selects the best route.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Netifd proto_add_host_dependency (called by wireguard) replacing unreachable route

2021-10-25 Thread Luiz Angelo Daros de Luca
Hello,

I have a static rule to reach a wireguard server through a specific
interface and an
unreachable route to make sure that the static route is the only way
to reach that
server.

10.1.2.1 via 10.3.1.5 dev eth1  src 10.3.1.6  metric 100
unreachable 10.1.2.1  metric 2147483645

After wg is up, wireguard.sh calls "proto_add_host_dependency wgint 10.1.2.1".
That call modifies the unreachable route to a normal route (it removes
the type).
The result is this:

10.1.2.1 via 10.3.1.5 dev eth1  src 10.3.1.6  metric 100
10.1.2.1 dev lo scope link  metric 2147483645

I think that netifd really wanted to add a dependency to the first
route, not the second one.
Maybe netifd should ignore those routes with types for host
dependencies, but I don't know  the consequences of that change.

Regards,

---
 Luiz Angelo Daros de Luca
luizl...@gmail.com

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel