From nobody Mon Apr 25 13:49:20 2022 X-Original-To: dev-commits-src-all@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 5AAAA1A9F316; Mon, 25 Apr 2022 13:49:21 +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 4Kn5wK1pJtz4sYj; Mon, 25 Apr 2022 13:49:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650894561; 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=vioWfpQvBdI+1czDfwdwTZcWCaadpcmI2r40liqy7rs=; b=OjPZ3UHzblE9SCbQZhygURwbmBvvjqkKe/GtCOMWtjzSvYufq3u00gZf3ATvMpQTbAPSyS Ym4KnJ7LtdcXEC8/fjehkrM69Hl9yOgj6Bzx1DS2kESlOfxq3tLOSlHx9F8kjhLCGadQnI KNz27FTN9nU9wNytoUymS/U8qX6pFbRVJ0NwGoxYkhOJryAStglVa35PToMrddcXfB4s0v ebbLPmH7NYYyYnNfSoWSkUTKN+VquEys1apE5AZbW+xL0oL5rXV2I6nIw17kRKklg7Wlxc 0MSpX99WZEKxAh79jsD/4+B2878hmyJYRN/oUS5dvbDngitauF3FjY5SOU38wg== 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 1964C1BDB7; Mon, 25 Apr 2022 13:49:21 +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 23PDnLGH078704; Mon, 25 Apr 2022 13:49:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23PDnKY8078703; Mon, 25 Apr 2022 13:49:20 GMT (envelope-from git) Date: Mon, 25 Apr 2022 13:49:20 GMT Message-Id: <202204251349.23PDnKY8078703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c93cddd19baf - stable/13 - libexec/rc.d/hostapd: Down/up interface when interface is specified List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c93cddd19baf396806a982f7659dcc77cdd5867e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650894561; 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=vioWfpQvBdI+1czDfwdwTZcWCaadpcmI2r40liqy7rs=; b=lVl+VQLCF61JrNjxGgjTv9jJmmYI2F8nBWy7ACf8NKNyZpB2xKkM/Bj0+LPcHLCPY2Z31v uTJUjhkKKcyNvhAIRYFqmUsmvrRbPgSHqbqqAwtpLrtH7/ZfjDIStnUoy4R27CbwK+PEXh vDeMN6Lqh8TTo+PMeoPOs2d7ZbcyynPbMX59c2Yl3myhvOTXM0QvTJ4retBAuGa1reyKPJ iKd7QFhWgGsVBwb71HcbjJdw8AygGvm8L1h3IjM1j3WDBedSJfFgkrHCPEbN/xBbwbktLC wtlyGAizXoZfqBCsU4nbyAnFF9f375JZJKNj1hcqXmWhwC3BZV7X63B8gFMeXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650894561; a=rsa-sha256; cv=none; b=uflkUfzBpB30QsN8Kq8BOX1qS/kwfiWxtSI9iWr391YU3VRfm35yHLQBW9Z0Qxm75PGol0 N8sPX+8hGZpFaG10NJ55CCW7AAOp1cxhXA57nOeKoDN+CYlXgtSDr4byI+Aq7T7i5S+UYS uC2vV2M/BvnumOC8N+bBu9l6t8mDlFZG9Roy9fzLF1PEDmvIigx1QNVbap65b6zb6xDeO8 6IvkHGYc2NNi6pHK7l/vfxkam7yx7pli8ucL3OhFiceKWO/zA9IljROVZm023Xz5z1e2hz AReqoSNPJ8sx4xh8Qki9pv6ahkxrtiGEN8hRxX/b6bqkqZP2eMQHdpbKe311OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c93cddd19baf396806a982f7659dcc77cdd5867e commit c93cddd19baf396806a982f7659dcc77cdd5867e Author: Cy Schubert AuthorDate: 2022-04-22 16:03:08 +0000 Commit: Cy Schubert CommitDate: 2022-04-25 13:49:04 +0000 libexec/rc.d/hostapd: Down/up interface when interface is specified When no interface is specified results in a syntax error in the rc script. Only execute poststart when an interface has been specified. PR: 263358 Submitted by: markj Reported by: Joshua Kinard Fixes: 0da2c91e64528d896f69d36670e25b4b4a140579 (cherry picked from commit 1452bfcd9bbcb2f5bbb89fa38d01ce51dd9b6d44) --- libexec/rc/rc.d/hostapd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libexec/rc/rc.d/hostapd b/libexec/rc/rc.d/hostapd index 7e1611350438..d2d8dd253efa 100755 --- a/libexec/rc/rc.d/hostapd +++ b/libexec/rc/rc.d/hostapd @@ -15,9 +15,11 @@ command=${hostapd_program} start_postcmd="hostapd_poststart" hostapd_poststart() { - ifconfig ${ifn} down - sleep 2 - ifconfig ${ifn} up + if [ -n "$ifn" ]; then + ifconfig ${ifn} down + sleep 2 + ifconfig ${ifn} up + fi } ifn="$2"