net: add DHCP Option 121 (Classless Static Routes) support#2123
Open
tpjg wants to merge 2 commits intonanovms:masterfrom
Open
net: add DHCP Option 121 (Classless Static Routes) support#2123tpjg wants to merge 2 commits intonanovms:masterfrom
tpjg wants to merge 2 commits intonanovms:masterfrom
Conversation
Implement RFC 3442 classless static routes received via DHCP: - Add IPv4 static route table with longest-prefix-match lookup - Parse Option 121 from DHCP ACK via LWIP_HOOK_DHCP_PARSE_OPTION - Consult static routes during IP routing via LWIP_HOOK_IP4_ROUTE_SRC - Ignore Option 3 (Router) when Option 121 is present per RFC 3442 - Request Option 121 in DHCP parameter request list - Clean up routes on DHCP release/stop Note: vendor/lwip/src/core/ipv4/dhcp.c also requires modification (see Makefile).
francescolavra
requested changes
Jan 10, 2026
Member
francescolavra
left a comment
There was a problem hiding this comment.
@tpjg thanks for your PR.
This feature can be implemented entirely within lwIP, I don't see any advantage in implementing it in the Nanos code base. The fact that you had to make changes to lwIP means that doing everything via lwIP hooks is not feasible, and lwIP needs to be aware of this feature.
So I would rather have everything done inside lwIP.
Author
|
Okay, I'll look into moving everything into lwIP. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement RFC 3442 classless static routes received via DHCP to support receiving multiple routes (not just a default gateway). This is especially useful for servers deployed with multiple interfaces, e.g. one 'public' and one 'private' network interface.
Amongst other things this can be used to receive the route to reach the http://169.254.169.254 endpoint.
This has been tested on OpenStack / OVHcloud. Note that this also requires a change in the vendored LWIP (the makefile now pulls from my fork).
Not sure if this is interesting to get into upstream and it definitely needs (a lot of) review, sharing nonetheless.