Do not request unused "classless-static-routes" dhcp-options(5)
authorkn <kn@openbsd.org>
Thu, 8 Apr 2021 17:29:17 +0000 (17:29 +0000)
committerkn <kn@openbsd.org>
Thu, 8 Apr 2021 17:29:17 +0000 (17:29 +0000)
Doing so implies support for it, but dhcpleased(8) currently ingores it
entirely and does not configure any route from it.

As per RFC 3442 servers SHOULD NOT respond with a "routers" option when
"classless-static-routes" is set.

dhcpd(8)/dhcpd.conf(5) follows that, hence requesting but not using static
routes results in not installing any routes at all.

Stop signaling support for this option and only request "routers" such that
dhcpleased continues to install a default route and properly ignores the
unsupported option if used by the server.

Report from Uwe Werler <uwe @ werler dot is> about a default route not
being set when requesting the "classless-static-routes" dhcp-options(5)
from dhcpd(8), thanks!

OK florian

sbin/dhcpleased/frontend.c

index 7631392..349055f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.8 2021/03/22 16:28:25 florian Exp $    */
+/*     $OpenBSD: frontend.c,v 1.9 2021/04/08 17:29:17 kn Exp $ */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -776,9 +776,9 @@ build_packet(uint8_t message_type, uint32_t xid, struct ether_addr *hw_address,
        static uint8_t   dhcp_client_id[] = {DHO_DHCP_CLIENT_IDENTIFIER, 7,
                HTYPE_ETHER, 0, 0, 0, 0, 0, 0};
        static uint8_t   dhcp_req_list[] = {DHO_DHCP_PARAMETER_REQUEST_LIST,
-               8, DHO_SUBNET_MASK, DHO_ROUTERS, DHO_DOMAIN_NAME_SERVERS,
+               7, DHO_SUBNET_MASK, DHO_ROUTERS, DHO_DOMAIN_NAME_SERVERS,
                DHO_HOST_NAME, DHO_DOMAIN_NAME, DHO_BROADCAST_ADDRESS,
-               DHO_DOMAIN_SEARCH, DHO_CLASSLESS_STATIC_ROUTES};
+               DHO_DOMAIN_SEARCH};
        static uint8_t   dhcp_requested_address[] = {DHO_DHCP_REQUESTED_ADDRESS,
                4, 0, 0, 0, 0};
        static uint8_t   dhcp_server_identifier[] = {DHO_DHCP_SERVER_IDENTIFIER,