genodelabs / genode

Genode OS Framework
https://genode.org/
Other
1.06k stars 250 forks source link

nic router: dns server list in one dhcp option #4242

Closed m-stein closed 3 years ago

m-stein commented 3 years ago

If there are multiple DNS server addresses, the NIC router DHCP server currently adds also multiple DHCP option 6 entries to responses where each option contains one address. This conflicts with https://datatracker.ietf.org/doc/html/rfc2132#section-3.8 which states that the addresses should be listed within one option 6 field without delimiter.

m-stein commented 3 years ago

Fixed: ad91f7d9e3 nic_router: make Ipv4_config a class ec33ed48c0 nic_router: list dns servers in one dhcp option 6

m-stein commented 3 years ago

I just asked myself whether it would be desirable to let the router's DHCP client still assume multiple option 6 entries (each potentially containing multiple addresses) in DHCP replies. With the above commit, the router would again only parse the first option 6 entry. The Linux IP stack supports parsing multiple entries for some reason that I don't know.

m-stein commented 3 years ago

Added a fixup: a86329499e fixup "nic_router: list dns servers in one dhcp option 6"

chelmuth commented 3 years ago

I just asked myself whether it would be desirable to let the router's DHCP client still assume multiple option 6 entries (each potentially containing multiple addresses) in DHCP replies. With the above commit, the router would again only parse the first option 6 entry. The Linux IP stack supports parsing multiple entries for some reason that I don't know.

IMO this is for robustness in heterogeneous environments with network equipment that behaves not standard compliant (like NIC router did before). Maybe DHCP relaying also brings such issues. It may be good to keep this support in our implementation too but it is not a must without any concrete scenario/use case.

m-stein commented 3 years ago

Thanks for that feedback. I'd vote for not adding the functionality until we encounter misbehaving equipment because I'd like to document why it was added.

chelmuth commented 3 years ago

The RFCs support my assumption that options should occur only once (with exceptions).

RFC2131: Options may appear only once, unless otherwise specified in the options document. The client concatenates the values of multiple instances of the same option into a single parameter list for configuration.

RFC2132: The domain name server option specifies a list of Domain Name System name servers available to the client. Servers SHOULD be listed in order of preference. [no exeception specified]

m-stein commented 3 years ago

Thanks for looking this up!