From 665300f1de7a790196e841021eeefbcdbb8f6d4b Mon Sep 17 00:00:00 2001 From: stsp Date: Thu, 22 Jul 2021 18:01:29 +0000 Subject: [PATCH] Make dhcpleased(8) always configure provided routes, regardless of whether the address we received in our lease is already configured. In the case I observed, no default route was added to the routing table even though the server provided both an address and a route option. As it happened the leased address was already configured on the interface. This should not prevent routing table updates, but it did. ok florian --- sbin/dhcpleased/dhcpleased.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c index 8fc60693f10..0e08c20bc0e 100644 --- a/sbin/dhcpleased/dhcpleased.c +++ b/sbin/dhcpleased/dhcpleased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpleased.c,v 1.15 2021/07/21 03:53:50 kn Exp $ */ +/* $OpenBSD: dhcpleased.c,v 1.16 2021/07/22 18:01:29 stsp Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -693,10 +693,10 @@ configure_interface(struct imsg_configure_interface *imsg) req_sin_mask->sin_addr.s_addr = imsg->mask.s_addr; if (ioctl(ioctl_sock, SIOCAIFADDR, &ifaliasreq) == -1) fatal("SIOCAIFADDR"); - - if (imsg->routes_len > 0) - configure_routes(RTM_ADD, imsg); } + if (imsg->routes_len > 0) + configure_routes(RTM_ADD, imsg); + req_sin_addr->sin_port = ntohs(CLIENT_PORT); if ((udpsock = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { log_warn("socket"); -- 2.20.1