From patchwork Thu Dec 1 17:23:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 6259 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 4NNNGG4tZYz3xkS for ; Thu, 1 Dec 2022 17:23:50 +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 4NNNFx1h91z2y4; Thu, 1 Dec 2022 17:23:33 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NNNFq0L9Lz30CW; Thu, 1 Dec 2022 17:23:27 +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 4NNNFl6bj2z30CS 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 4NNNFl2M79z2QM; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4NNNFl24xNzTjnB; Thu, 1 Dec 2022 17:23:23 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 20/29] dhcpcd.exe: Run everything no matter how RED is configured Date: Thu, 1 Dec 2022 17:23:09 +0000 Message-Id: <20221201172318.3166615-20-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" This could potentially create problems when we abuse these functions to launch the DHCP client on IPTV interfaces. This would have to be tested and confirmed or potentially we would need some more changes to keep supporting that use-case, too. Signed-off-by: Michael Tremer --- src/initscripts/networking/dhcpcd.exe | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/initscripts/networking/dhcpcd.exe b/src/initscripts/networking/dhcpcd.exe index 440a76693..f6e494f96 100644 --- a/src/initscripts/networking/dhcpcd.exe +++ b/src/initscripts/networking/dhcpcd.exe @@ -34,7 +34,6 @@ dhcpcd_up() exit 0; fi - # Only if RED_TYPE=DHCP update /var/ipfire/red # Check if we have to restart the services at update [ ! -e "/var/ipfire/red/active" ] && update=1; if [ "$old_domain_name_service" != "$new_domain_name_service" ]; then @@ -82,13 +81,12 @@ dhcpcd_down() # Remove DNS servers rm -f /var/run/dns1 /var/run/dns2 - # Only if RED_TYPE=DHCP update /var/ipfire/red - if [ "$RED_TYPE" == "DHCP" ]; then - rm -f /var/ipfire/red/active - if [ ! $reason == "PREINIT" ]; then - logger -p local0.info -t dhcpcd.exe[$$] "${interface} has been brought down ($reason)" - run_subdir ${rc_base}/init.d/networking/red.down/ - fi + # Consider RED to be no longer active + rm -f /var/ipfire/red/active + + if [ ! $reason == "PREINIT" ]; then + logger -p local0.info -t dhcpcd.exe[$$] "${interface} has been brought down ($reason)" + run_subdir ${rc_base}/init.d/networking/red.down/ fi # Remove any configured IP address from the device