From owner-svn-src-all@freebsd.org Tue Sep 3 14:06:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 769DFDC6F0; Tue, 3 Sep 2019 14:06:18 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46N7zF6dTFz4PPD; Tue, 3 Sep 2019 14:06:17 +0000 (UTC) (envelope-from yuripv@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1452) id 86F241A453; Tue, 3 Sep 2019 14:06:04 +0000 (UTC) X-Original-To: yuripv@localmail.freebsd.org Delivered-To: yuripv@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 039001658C; Fri, 5 Apr 2019 22:45:39 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEBDD81D26; Fri, 5 Apr 2019 22:45:36 +0000 (UTC) (envelope-from owner-src-committers@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 538) id 10E68161D9; Fri, 5 Apr 2019 22:45:15 +0000 (UTC) Delivered-To: src-committers@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id 00480161D6 for ; Fri, 5 Apr 2019 22:45:14 +0000 (UTC) (envelope-from eugen@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A12F818D2; Fri, 5 Apr 2019 22:45:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52F1F1BB6B; Fri, 5 Apr 2019 22:45:09 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x35Mj9ea097170; Fri, 5 Apr 2019 22:45:09 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x35Mj9Rd097169; Fri, 5 Apr 2019 22:45:09 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201904052245.x35Mj9Rd097169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r345970 - head/libexec/rc X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/libexec/rc X-SVN-Commit-Revision: 345970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Loop: FreeBSD.org Sender: owner-src-committers@freebsd.org X-Rspamd-Queue-Id: DEBDD81D26 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Status: O X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Tue, 03 Sep 2019 14:06:45 -0000 X-Original-Date: Fri, 5 Apr 2019 22:45:09 +0000 (UTC) X-List-Received-Date: Tue, 03 Sep 2019 14:06:45 -0000 Author: eugen Date: Fri Apr 5 22:45:08 2019 New Revision: 345970 URL: https://svnweb.freebsd.org/changeset/base/345970 Log: network.subr: improve configuration of cloned gif(4) interfaces ifconfig(8) syntax allows to specify only single address_family, so we need additional invocation of ifconfig to support configuration of cloned gif interface that may use different address families for its internal and external addresses. Also, ifconfig(8) does not allow to omit "inet6" keyword for address family specifying IPv6 addresses as outer addresses of the interface. Also, address_family is not "parameter" and it has to go before parameters including "tunnel" keyword, so "ifconfig gif0 tunnel inet6 $oip1 $oip2" would be wrong syntax and only "ifconfig gif0 inet6 tunnel $oip1 $oip2" is right. With this change, the following works: gifconfig_gif0="inet6 2a00::1 2a01::1" ifconfig_gif0="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" MFC after: 2 weeks Modified: head/libexec/rc/network.subr Modified: head/libexec/rc/network.subr ============================================================================== --- head/libexec/rc/network.subr Fri Apr 5 22:45:01 2019 (r345969) +++ head/libexec/rc/network.subr Fri Apr 5 22:45:08 2019 (r345970) @@ -1328,7 +1328,7 @@ wlan_down() # clone_up() { - local _list ifn ifopt _iflist _n tmpargs + local _list ifn ifopt _iflist _inet6 _n tmpargs _list= _iflist=$* @@ -1394,9 +1394,21 @@ clone_up() esac if [ $? -eq 0 ]; then _list="$_list $ifn" + tmpargs=$(get_if_var $ifn gifconfig_IF) + _inet6='' + case "$tmpargs" in + '') + ;; + inet6[[:space:]]*) + tmpargs=${tmpargs#inet6} + _inet6=inet6 + # FALLTHROUGH + ;& + *) + ${IFCONFIG_CMD} $ifn $_inet6 tunnel $tmpargs + ;; + esac fi - tmpargs=$(get_if_var $ifn gifconfig_IF) - eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\" done if [ -n "${_list# }" ]; then echo "Created clone interfaces: ${_list# }."