From nobody Mon Mar 06 15:08:31 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PVhmJ22qrz3x0qD; Mon, 6 Mar 2023 15:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PVhmJ1Zdjz3n7x; Mon, 6 Mar 2023 15:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678115312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4en3jjBPUoxHnhpzGHNNLwUG7I+Midro6Jwiwugk44A=; b=HLDQXEvmBx9nc4OfYdd4tGuHdVghdU8aKAcvqBCpFbu+V054tGCVNksUPMugEX6k2PI6fz bFFilbK3NICQ9DeyRvAS2jCMUGnBQW9D8sPHx/esVCIqVSlhDLxOZtsv1UMKyt/6l6Vvk9 R9oNg06B3iBSNTgXaheRLJRIQVNItuaJ01PtcQk3TCu79onQGVdr0HiH+vZqqCEbJo6WtD qgDt/F0F4mOAUH0HtfaPEN6lUkyVt1/JNStmF8tI+p0GEkx4oqNAE9SgtMVHbMh8ZetY46 iSBE9VoGQ4nkxCqCRbe0xo3a8kqqYfve/UIH257oYtnWfcLEwSe198w+GfsW7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678115312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4en3jjBPUoxHnhpzGHNNLwUG7I+Midro6Jwiwugk44A=; b=NnD/dfV1ZgvrWkGf+5eOgImXLdUQJn+tFigHXPxPIE+TtFMymdq1PXcVR5Dl4zD/RXhMZu IkHLm/btfc2gPWyvKPeBXiZH5iPBzk/fA+7z6CTFJKhOj801tCw1IGk+O/Mf/CDkP7EqBz MyCnu0Cy67mz1if7i+wRYsUS1ElW0nyuWq4UrwxnjJe1bQhJtH+iScd8eI7XVI5501a95O OgIbkkR7LRhcdvyp28840SX5nM3M9df5Wpey1MJINigNohYinlbvS53rdR5MCVM19xmM9S SUku7WJXXoTJeaXjXETzWZP6CZ9p/RA2kBCSL029Aly1W0v46kCm1joq0H9MvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678115312; a=rsa-sha256; cv=none; b=C8zWGczxqz3aWJEtx6NmePvaIglViOzZJtnevVoa81ElZ0Lg0+kRx8nUafbSLpIm+vaBL/ FaPgsGaMOBoOhjafJ4ffsig0prdv2XEqsnBFDtuMxmH3Y1EpaaK8DsghV0Uf7WFldxycd2 FpqqLha0mGQfZjAWA9qVZmf2qLuZ5LW81n4UxYVkdHlxGT2RTU/cSTj2obrbxKpIUKqhto LHpH4cIGgmu+v6pQ/R5gBazpEchYy+qgJyXHtvKdy9PlPNEVxPu4np/8n349vV773sPo4W zcHFHKLBrlETvAzSnQtpGnZobxUpyNtxBbZfLKFsvsCb0YrCQHbKqckRcfRiLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PVhmJ0YXHz15pn; Mon, 6 Mar 2023 15:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 326F8V3W076693; Mon, 6 Mar 2023 15:08:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 326F8VBV076692; Mon, 6 Mar 2023 15:08:31 GMT (envelope-from git) Date: Mon, 6 Mar 2023 15:08:31 GMT Message-Id: <202303061508.326F8VBV076692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: e2dc8d789f68 - main - dhclient: do not add 0.0.0.0 interface alias. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e2dc8d789f68a9a2267c7f1006aba36c7840b177 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=e2dc8d789f68a9a2267c7f1006aba36c7840b177 commit e2dc8d789f68a9a2267c7f1006aba36c7840b177 Author: Alexander V. Chernikov AuthorDate: 2023-03-04 15:18:26 +0000 Commit: Alexander V. Chernikov CommitDate: 2023-03-06 15:08:09 +0000 dhclient: do not add 0.0.0.0 interface alias. Subscribers: imp Differential Revision: https://reviews.freebsd.org/D38908 --- sbin/dhclient/dhclient-script | 3 +-- sbin/dhclient/dispatch.c | 27 ++++++++------------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/sbin/dhclient/dhclient-script b/sbin/dhclient/dhclient-script index c5649e1a1d2a..bcc9050407d4 100755 --- a/sbin/dhclient/dhclient-script +++ b/sbin/dhclient/dhclient-script @@ -318,13 +318,12 @@ fi case $reason in MEDIUM) eval "$IFCONFIG $interface $medium" - eval "$IFCONFIG $interface inet -alias 0.0.0.0 $medium" >/dev/null 2>&1 sleep 1 ;; PREINIT) delete_old_alias - $IFCONFIG $interface inet alias 0.0.0.0 netmask 255.0.0.0 broadcast 255.255.255.255 up + eval "$IFCONFIG $interface up" ;; ARPCHECK|ARPSEND) diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 91f1694ec902..29ae73103913 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -78,6 +78,7 @@ discover_interfaces(struct interface_info *iface) { struct ifaddrs *ifap, *ifa; struct ifreq *tif; + int len = IFNAMSIZ + sizeof(struct sockaddr_storage); if (getifaddrs(&ifap) != 0) error("getifaddrs failed"); @@ -118,26 +119,14 @@ discover_interfaces(struct interface_info *iface) iface->hw_address.htype = HTYPE_ETHER; /* XXX */ memcpy(iface->hw_address.haddr, LLADDR(foo), foo->sdl_alen); - } else if (ifa->ifa_addr->sa_family == AF_INET) { - struct sockaddr_in foo; - struct iaddr addr; - - memcpy(&foo, ifa->ifa_addr, sizeof(foo)); - if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) - continue; - if (!iface->ifp) { - if ((tif = calloc(1, sizeof(struct ifreq))) - == NULL) - error("no space to remember ifp"); - strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); - memcpy(&tif->ifr_addr, ifa->ifa_addr, - ifa->ifa_addr->sa_len); - iface->ifp = tif; - iface->primary_address = foo.sin_addr; - } - addr.len = 4; - memcpy(addr.iabuf, &foo.sin_addr.s_addr, addr.len); } + if (!iface->ifp) { + if ((tif = calloc(1, len)) == NULL) + error("no space to remember ifp"); + strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); + iface->ifp = tif; + } + } if (!iface->ifp)