Netifd proto_add_host_dependency (called by wireguard) replacing unreachable route

Luiz Angelo Daros de Luca luizluca at gmail.com
Mon Oct 25 16:38:48 PDT 2021


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
            luizluca at gmail.com



More information about the openwrt-devel mailing list