Ipv4RoutingTable overwrites settings from Ipv4NetworkConfigurator
When configuring an interface with Ipv4NetworkConfigurator, there is a config option (add-subnet-route="false") to prevent the addition of the subnet to the routing table.
However, when initializing the routing table of this host,
Ipv4RoutingTable::updateNetmaskRoutes() is called.
This function doesn't care (and know) about add-subnet-route and happily adds the subnets to the routing table, even if I didn't want it to.
Example snippet from configuration.xml:
<interface hosts='routersAlongPath[0]' names="wlan0" address='10.2.2.1' netmask='255.255.255.0' add-subnet-route="false" />
and I still get this route in its routing table:
[1] C 10.2.2.0/24 gw:* metric:1 if:wlan0
I can give more info if needed. I guess this is not intended behaviour? I can also draft a PR, but then I would need some guidelines.
This behavior is kept for backward compatibility. Note that the Ipv4NetworkConfigurator module is not a mandatory component, there are many ways to build a network.
Also, there is a netmaskRoutes parameter in Ipv4RoutingTable that specifies the network interfaces for which the routing table maintains netmask routes. This is set to "*" by default, which means all interfaces will have their netmask routes. If you set this parameter to "" then no interfaces will have their netmask routes maintained.
Forgot to answer, but your quick response is appreciated. Don't have anything else to add :)