From: kn Date: Thu, 28 Oct 2021 09:44:49 +0000 (+0000) Subject: Accept server replies from any server port X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a1c11753b970f2dc16d85ad9fffac0f76245c3f3;p=openbsd Accept server replies from any server port There is no requirement other than replying to client port 68/udp as per RFC 2131, so drop the 67/udp check. Same conclusion from florian Reported and tested by Roc Vallès < vallesroc AT gmail DOT com>, thanks! --- diff --git a/sbin/dhcpleased/engine.c b/sbin/dhcpleased/engine.c index 40574ef1aa2..2033ea6ac76 100644 --- a/sbin/dhcpleased/engine.c +++ b/sbin/dhcpleased/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.27 2021/09/15 15:18:23 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.28 2021/10/28 09:44:49 kn Exp $ */ /* * Copyright (c) 2017, 2021 Florian Obser @@ -830,13 +830,6 @@ parse_dhcp(struct dhcpleased_iface *iface, struct imsg_dhcp *dhcp) ntohs(udp->uh_sport), hbuf_dst, ntohs(udp->uh_dport)); } - if (ntohs(udp->uh_sport) != SERVER_PORT || - ntohs(udp->uh_dport) != CLIENT_PORT) { - log_warnx("%s: invalid ports used %s:%d -> %s:%d", __func__, - hbuf_src, ntohs(udp->uh_sport), - hbuf_dst, ntohs(udp->uh_dport)); - return; - } if (rem < sizeof(*dhcp_hdr)) goto too_short;