From patchwork Wed Aug 11 16:08:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jouke Witteveen X-Patchwork-Id: 1951 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [95.216.189.61] by patchwork.archlinux.org with IMAP (fetchmail-6.4.20) for (single-drop); Wed, 11 Aug 2021 16:09:16 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id UJwJCiz2E2GKJQEAK+/4rw (envelope-from ) for ; Wed, 11 Aug 2021 16:09:16 +0000 Received: from lists.archlinux.org (lists.archlinux.org [IPv6:2a01:4f9:c010:9eb4::1]) (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) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 1C9F781934C; Wed, 11 Aug 2021 16:09:15 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id A6F156ED4BF; Wed, 11 Aug 2021 16:09:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-rsa; t=1628698154; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=oNn4rjKZEnaywkbNDL1MmAb+Shd4JD+k90b6iInv5JA=; b=p7CMUJYnWKNqrYEXuKRiIGu4vjG5UIPj0/LzijSFNnTaixd4mg8pdqP8DY6CNwCNM7r9Ha KHY41lHJeTlSRpIwJe9NsAhuqUoJ4AgN11ZU+9Y0q7pJQ36EQgejXQ85wUrqB0p/BVa3rO wx+ubsuYwLs35/FTu3D8p9IHObBxu5cfptNaSfVGpi8dMLtHnqcsSAe6KN3i/DDGaqCSxY JgvVZmGBHpo4KFiF5HMzb/hQmIcsqfdfcJMpK6vpN2WKw0P7/rByd/S277StllktVLkj7U 3ObIsyDFY6Xt89Ow0BH92xMHUotwLAUrLgrgMfwN7x9iOTSsSAGCuM35N7c0Fq2hXV/Ymn EZYSXeGwSo0Wf+mtfcAnMyRzeD9AaxMmlNPsqoN6lkUcTlctGAJnjLkyMUv94VJchl1/9W Rjk42J/rwXAjQWXYkCGjOd1WwH50DzvZprYE1p7sgTnZWUZqGAVhFPnKp2GT2f+ufo7SkT 3wDwA6nkKRVGVSPqLRAeXkhrhVk4J8PQk8WFgD2r22WkBqehtV4iTwKT+ltcMpKRzY0REp w3lFZoA/OvGr+CGzwPiqkQRDFOwKXN58EJIV5C0LTmjdEe8k68wIA1yUevodN0Fhx9oFZ9 EkSaaxwwpjvuhCUdccf3DX71MrYSylYNiG3dwRi2B/6U4y5iq6r5w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-ed25519; t=1628698154; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=oNn4rjKZEnaywkbNDL1MmAb+Shd4JD+k90b6iInv5JA=; b=6nXzbVkLzbR5JmFNlK1R00ybL1BjnDQ23a4VcJByMn8dE1d/pO5CEVmrT0xgZJG2kKEQ+O hxpImwfre5OpqkBA== X-Original-To: arch-projects@lists.archlinux.org Delivered-To: arch-projects@lists.archlinux.org Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lists.archlinux.org (Postfix) with ESMTPS id 8849F6ED4A3 for ; Wed, 11 Aug 2021 16:09:12 +0000 (UTC) Received: by mail-ed1-x535.google.com with SMTP id d6so4528408edt.7 for ; Wed, 11 Aug 2021 09:09:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=oNn4rjKZEnaywkbNDL1MmAb+Shd4JD+k90b6iInv5JA=; b=H1CwzfKXsqLMRgGhz6nxJYFk7cakb2vlkoX7MyqfTwx+PKOhcmsnQuiER0d2A2s3GA U8c8QpYKRkeqGj1xAnZUEE1n6BiQ+1Xje/TGwGfPHttmGRIcelIJmBULDLwcFrCt9fX5 oQjBibTQqrt4fDuKiWAzUAY6HBowhs7xEiEctkgwieNc6T+KoSNffArjP/EZ2D8a6Tkp asUwpKwHvpr4NLHr8Y3ca5SsKtIZ/LMxz+0WLyR448+5LajZHFejZuojr00GYbHf+YED V6Rc9+Tfd5OM+YtqePjWxj1Ngt2c2M8sth0jsRDaga/AnsGQbff8Pzsu6Ha5pt3uJ8Wp rdAw== X-Gm-Message-State: AOAM530s2Fa2pJk7I78nTPG6FHi60jgDjunjM2AK5hWmg4upMNJGxMjl U1BwVPQ4A9kNmetk8c41oKpBgdV5eKry2A== X-Google-Smtp-Source: ABdhPJzDrBCckn+sSdZ8YVO1GbzBf/GfnoqDBb5FJftLEtYukNls1VlhaZ5w0RwWHR6H/mpKErRH6g== X-Received: by 2002:a05:6402:184b:: with SMTP id v11mr12246593edy.267.1628698151855; Wed, 11 Aug 2021 09:09:11 -0700 (PDT) Received: from Mindship-06.localdomain (252-168-166-62.ftth.glasoperator.nl. [62.166.168.252]) by smtp.gmail.com with ESMTPSA id c8sm4586407ejp.124.2021.08.11.09.09.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 09:09:10 -0700 (PDT) Date: Wed, 11 Aug 2021 18:08:57 +0200 To: arch-projects@lists.archlinux.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline Subject: [arch-projects] [netctl][PATCH] Reach network.target before communicating X-BeenThere: arch-projects@lists.archlinux.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Arch Linux projects development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jouke Witteveen via arch-projects From: Jouke Witteveen Reply-To: Arch Linux projects development discussion Cc: Jouke Witteveen Errors-To: arch-projects-bounces@lists.archlinux.org Sender: "arch-projects" Authentication-Results: mail.archlinux.org; dkim=pass header.d=lists.archlinux.org header.s=dkim-rsa header.b=p7CMUJYn; dkim=pass header.d=lists.archlinux.org header.s=dkim-ed25519 header.b=6nXzbVkL; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of arch-projects-bounces@lists.archlinux.org designates 2a01:4f9:c010:9eb4::1 as permitted sender) smtp.mailfrom=arch-projects-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 1C9F781934C X-Spamd-Result: default: False [-3.91 / 15.00]; HAS_REPLYTO(0.00)[arch-projects@lists.archlinux.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_IN_DNSWL_MED(-0.20)[2a01:4f9:c010:9eb4::1:from]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[archlinux.org,none]; DKIM_TRACE(0.00)[lists.archlinux.org:+]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f9::/32, country:DE]; FROM_NEQ_ENVFROM(0.00)[arch-projects@lists.archlinux.org,arch-projects-bounces@lists.archlinux.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(-0.20)[lists.archlinux.org:s=dkim-rsa,lists.archlinux.org:s=dkim-ed25519]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_MED(-2.00)[archlinux.org:dkim]; TAGGED_RCPT(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[arch-projects@lists.archlinux.org]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::535:received]; NEURAL_HAM(-0.00)[-1.000]; FREEMAIL_CC(0.00)[gmail.com]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org Let the netctl profile service yield at the last moment before any communication on the interface takes place. That way, we catch as many problems as possible without suffering unpredictable delays. This means network.target is reached earlier for wireless connections. --- src/lib/connections/mobile_ppp | 3 +-- src/lib/connections/pppoe | 2 +- src/lib/connections/wireless | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/connections/mobile_ppp b/src/lib/connections/mobile_ppp index 9e07ef9..8ad7a15 100644 --- a/src/lib/connections/mobile_ppp +++ b/src/lib/connections/mobile_ppp @@ -19,8 +19,6 @@ mobile_ppp_up() { rf_enable "$Interface" "$RFKill" || return 1 fi - network_ready - mkdir -p "$options_dir" if [[ -z $ChatScript ]]; then ChatScript="$options_dir/modem.chat" @@ -83,6 +81,7 @@ connect $(quote_word "/usr/sbin/chat -v -t15 -f $(quote_word "$ChatScript")") ${OptionsFile:+file $(quote_word "$OptionsFile")} EOF + network_ready if ! $PPPD file "$options_dir/options"; then rm -r "$options_dir" report_error "Could not establish a ppp connection for profile '$Profile'." diff --git a/src/lib/connections/pppoe b/src/lib/connections/pppoe index 35bccf7..aab6168 100644 --- a/src/lib/connections/pppoe +++ b/src/lib/connections/pppoe @@ -18,7 +18,6 @@ pppoe_up() { report_error "Failed to bring interface '$Interface' up" return 1 fi - network_ready mkdir -p "$(dirname "$options")" cat >> "$options" << EOF @@ -48,6 +47,7 @@ password $(quote_word "$Password") ${OptionsFile:+file $(quote_word "$OptionsFile")} EOF + network_ready if ! $PPPD file "$options"; then rm "$options" rmdir "$(dirname "$options")" diff --git a/src/lib/connections/wireless b/src/lib/connections/wireless index aeec060..5444baa 100644 --- a/src/lib/connections/wireless +++ b/src/lib/connections/wireless @@ -49,6 +49,7 @@ wireless_up() { return 1 fi + network_ready # Bring interface up after starting wpa_supplicant # This is important since cards such as iwl3945 do not support # mode switching when they are already up.