From: florian Date: Tue, 27 Jul 2021 18:17:37 +0000 (+0000) Subject: Please muscle memory when dhclient $if is run and request a new lease. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bc837866265349424953a2f715f5a8b8b5231b72;p=openbsd Please muscle memory when dhclient $if is run and request a new lease. An upcoming diff for dhclient(8) will make it exit when it discovers an autoconf flag at startup. "Quite a pleasing diff." deraadt@ --- diff --git a/sbin/dhcpleased/frontend.c b/sbin/dhcpleased/frontend.c index 9246960512e..bf33e6e5e48 100644 --- a/sbin/dhcpleased/frontend.c +++ b/sbin/dhcpleased/frontend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: frontend.c,v 1.14 2021/07/26 09:26:36 florian Exp $ */ +/* $OpenBSD: frontend.c,v 1.15 2021/07/27 18:17:37 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -761,6 +761,16 @@ handle_route_message(struct rt_msghdr *rtm, struct sockaddr **rti_info) log_debug("RTP_PROPOSAL_SOLICIT"); frontend_imsg_compose_engine(IMSG_REPROPOSE_RDNS, 0, 0, NULL, 0); + } else if (rtm->rtm_flags & RTF_PROTO3) { + uint32_t if_index; + char ifnamebuf[IF_NAMESIZE], *if_name; + + if_index = rtm->rtm_index; + if_name = if_indextoname(if_index, ifnamebuf); + log_warnx("\"dhclient %s\" ran, requesting new lease", + if_name != NULL ? if_name : "(unknown)"); + frontend_imsg_compose_engine(IMSG_CTL_SEND_REQUEST, + 0, 0, &if_index, sizeof(if_index)); } break; default: