[OpenWrt-Devel] netifd: need help to fix FS#1463 - route with gateway absent or 0.0.0.0

Luiz Angelo Daros de Luca luizluca at gmail.com
Thu Sep 6 16:53:17 EDT 2018


Hello,

Docs are clear that when a route does not have the gateway field, it
will use the one from interface. However, it does not work like that.
When a route does not have a gateway, it is added as an onlink route.

I added a flag to differ between '0.0.0.0' and when gateway is absent.
The problem now is to get interface gateway. It looks like
interface_set_route_info is the place where a route copy missing
information from interface. However, at the time it runs, at least for
proto dhcp, iface->proto_ip->route and iface->config_ip->route are
empty. When interface gets an address from DHCP,
proto_shell_parse_route_list is called to add the default route.

Shouldn't the interface routes be included only after the interface is
up and configured (proto_shell_update_link) and not from the config
init (config_init_routes)?

My WIP is here
https://github.com/luizluca/netifd/commit/7ab84972bda51d34295d1938e07ed7efc3b2215d

Regards,
---
     Luiz Angelo Daros de Luca
            luizluca at gmail.com

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list