From e81612d0f232d16eb25c70cbc58d30588a924b20 Mon Sep 17 00:00:00 2001 From: florian Date: Thu, 16 Sep 2021 13:36:52 +0000 Subject: [PATCH] dhcpleased(8) does not (yet?) track if routes it added are deleted behind its back. When a lease gets renewed dhcpleased simply adds all routes and lets the kernel sort duplicates out. This however leads to "failed to send route message: File exists" messages in /var/log/daemon which are confusing. Since this is expected do not log it as an error. While here change the error message when proposing nameservers so that it can be distinguished from failed routes. Pointed out by deraadt --- sbin/dhcpleased/dhcpleased.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sbin/dhcpleased/dhcpleased.c b/sbin/dhcpleased/dhcpleased.c index 3f9f10714e9..c8cc8e14d04 100644 --- a/sbin/dhcpleased/dhcpleased.c +++ b/sbin/dhcpleased/dhcpleased.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcpleased.c,v 1.20 2021/08/24 14:54:02 florian Exp $ */ +/* $OpenBSD: dhcpleased.c,v 1.21 2021/09/16 13:36:52 florian Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -1098,8 +1098,10 @@ configure_route(uint8_t rtm_type, uint32_t if_index, int rdomain, struct rtm.rtm_msglen += padlen; } - if (writev(routesock, iov, iovcnt) == -1) - log_warn("failed to send route message"); + if (writev(routesock, iov, iovcnt) == -1) { + if (errno != EEXIST) + log_warn("failed to send route message"); + } } #ifndef SMALL @@ -1177,7 +1179,7 @@ propose_rdns(struct imsg_propose_rdns *rdns) } if (writev(routesock, iov, iovcnt) == -1) - log_warn("failed to send route message"); + log_warn("failed to propose nameservers"); } void -- 2.20.1