From patchwork Thu Dec 1 17:23:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 6257 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4NNNGD3ZjLz3xlD for ; Thu, 1 Dec 2022 17:23:48 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFt6nTmz2NB; Thu, 1 Dec 2022 17:23:30 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NNNFp5QTTz30CV; Thu, 1 Dec 2022 17:23:26 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4NNNFl5R4Xz30CH for ; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4NNNFl46p2z2tG; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4NNNFl3txBzTjnF; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 26/29] network: Force dhcpcd to ask for an IP address Date: Thu, 1 Dec 2022 17:23:15 +0000 Message-Id: <20221201172318.3166615-26-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221201172318.3166615-1-michael.tremer@ipfire.org> References: <20221201172318.3166615-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" So since all this static nonsense wasn't feeling right, I opened a ticket upstream and got a lead how to actually get some proper DHCP working. https://github.com/NetworkConfiguration/dhcpcd/issues/129 Signed-off-by: Michael Tremer --- src/initscripts/networking/dhcpcd.exe | 95 --------------------------- src/initscripts/networking/red | 2 +- 2 files changed, 1 insertion(+), 96 deletions(-) diff --git a/src/initscripts/networking/dhcpcd.exe b/src/initscripts/networking/dhcpcd.exe index 220f95c83..c8a79999d 100644 --- a/src/initscripts/networking/dhcpcd.exe +++ b/src/initscripts/networking/dhcpcd.exe @@ -60,18 +60,6 @@ dhcpcd_up() mv /tmp/hosts /etc/hosts fi - # Try to set the default route if there is none - # This can happen when we are using the 3RD party configuration - # This should not be necessary, since dhcpcd says it will configure - # a default route, but that does not seem to happen: - # https://github.com/NetworkConfiguration/dhcpcd/issues/129 - if ! ip route 2>/dev/null | grep ^default && [ -s "/var/ipfire/red/remote-ipaddress" ]; then - gateway=$( /var/ipfire/red/remote-ipaddress - - # Configure the default route - ip route add default via "${gateway}" mtu "${mtu}" - fi - - # Store and DNS servers - if [ -n "${dns1}" ]; then - echo -n "${dns1}" > /var/ipfire/red/dns1 - fi - if [ -n "${dns2}" ]; then - echo -n "${dns2}" > /var/ipfire/red/dns2 - fi - - return 0 -} - case "${reason}" in BOUND|INFORM|REBIND|REBOOT|RENEW|TIMEOUT|STATIC) dhcpcd_up @@ -194,9 +102,6 @@ case "${reason}" in PREINIT|EXPIRE|FAIL|IPV4LL|NAK|RELEASE|STOP) dhcpcd_down ;; - 3RDPARTY) - dhcpcd_3rdparty - ;; # Ignored events where we do not need to do anything STOPPED|CARRIER|NOCARRIER) ;; diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red index 2d68c1685..f927ddbfb 100644 --- a/src/initscripts/networking/red +++ b/src/initscripts/networking/red @@ -227,7 +227,7 @@ case "${1}" in ip link set "${RED_DEV}" up &>/dev/null # Start the DHCP client - dhcpcd_start "${RED_DEV}" --nolink + dhcpcd_start "${RED_DEV}" --dhcp # Done exit 0