Adding support for DHCP option 121#15
Conversation
Move route table and option parser from nanos into lwip, gated by LWIP_DHCP_CLASSLESS_STATIC_ROUTES. Pass netif to dhcp_parse_reply() to eliminate the nanos_dhcp_current_netif workaround.
There was a problem hiding this comment.
Hi @tpjg. There is a missing part in this implementation: the router addresses received from the DHCP server via option 121 are being parsed and added to the static routes, but are not actually being used when routing outgoing packets.
routes Also removes some references to nanos in comments.
Argh. Absolutely correct. Very sorry, I was focussed (too much) on the cloud instance metadata at 169.254.169.254 that is 'on net' caught by the |
francescolavra
left a comment
There was a problem hiding this comment.
Hi @tpjg
Most of my comments are about simplifying the code and minimizing the computational load required to walk the routing table. Since this code is potentially run for every outgoing network packet whose destination doesn't fit in the subnet of the interface, it should be as efficient as possible.
Remove dhcp_classless_route.c; move parser into dhcp.c as static function. Replace option121_received array with ip4_route_exists(). Use LWIP_ERROR, lwip_htonl where appropriate.
|
@tpjg I reviewed your latest changes and they look good to me. There are still a few unresolved issues, do you have time to address them? If not, I could do it myself in a new PR (of course preserving your authorship info). |
See nanovms/nanos#2123