inet icon indicating copy to clipboard operation
inet copied to clipboard

Ipv4RoutingTable overwrites settings from Ipv4NetworkConfigurator

Open th1j5 opened this issue 2 years ago • 2 comments

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.

th1j5 avatar Apr 07 '23 17:04 th1j5

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.

levy avatar Apr 11 '23 14:04 levy

Forgot to answer, but your quick response is appreciated. Don't have anything else to add :)

th1j5 avatar Apr 24 '23 12:04 th1j5