From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RdHGc-0005rr-VC for garchives@archives.gentoo.org; Wed, 21 Dec 2011 08:11:15 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6988C21C06B; Wed, 21 Dec 2011 08:11:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3666321C06B for ; Wed, 21 Dec 2011 08:11:07 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ABA731B401F for ; Wed, 21 Dec 2011 08:11:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id DFA1480042 for ; Wed, 21 Dec 2011 08:11:05 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: net/ X-VCS-Repository: proj/openrc X-VCS-Files: net/iproute2.sh X-VCS-Directories: net/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: e5eb062f050d96a70f72ee78f431f774c98b24e2 Date: Wed, 21 Dec 2011 08:11:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: e502e07a-66cd-42fe-88c8-a9fbf399442c X-Archives-Hash: 9f5533c34bd77986efb4f356760975ee commit: e5eb062f050d96a70f72ee78f431f774c98b24e2 Author: Robin H. Johnson gentoo org> AuthorDate: Wed Dec 21 07:44:53 2011 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Wed Dec 21 08:02:53 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3De5eb062f net/iproute2: iproute2 flag handling Several of the optional flags were not being handled correctly, they were being passed as values only, without the keyword before them. Affected keywords: anycast, label, scope, valid_lft, preferred_lft Also change the handling of keywords to a common setup now, making broadcast and peer strings the same as the above keywords. Signed-off-by: Robin H. Johnson gentoo.org> --- net/iproute2.sh | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/net/iproute2.sh b/net/iproute2.sh index c8f670c..c3bb9c8 100644 --- a/net/iproute2.sh +++ b/net/iproute2.sh @@ -113,31 +113,35 @@ _add_address() =20 local address netmask broadcast peer anycast label scope local valid_lft preferred_lft home nodad + local confflaglist address=3D"$1" ; shift while [ -n "$*" ]; do case "$1" in netmask) netmask=3D"/$(_netmask2cidr "$2")" ; shift ; shift ;; broadcast|brd) - broadcast=3D"broadcast $2" ; shift ; shift ;; + broadcast=3D"$2" ; shift ; shift ;; pointopoint|pointtopoint|peer) - peer=3D"peer $2" ; shift ; shift ;; + peer=3D"$2" ; shift ; shift ;; anycast|label|scope|valid_lft|preferred_lft) eval "$1=3D$2" ; shift ; shift ;; home|nodad) - eval "$1=3D$1" ; shift ;; + # FIXME: If we need to reorder these, this will take more code + confflaglist=3D"${confflaglist} $1" ; shift ;; esac done =20 # Always scope lo addresses as host unless specified otherwise if [ "${IFACE}" =3D "lo" ]; then - [ -z "$scope" ] && scope=3D"scope host" + [ -z "$scope" ] && scope=3D"host" fi =20 # figure out the broadcast address if it is not specified - [ -z "$broadcast" ] && broadcast=3D"broadcast +" + # FIXME: I'm not sure if this should be set if we are passing a peer ar= g + [ -z "$broadcast" ] && broadcast=3D"+" =20 - set -- "${address}${netmask}" $peer $broadcast $anycast $label $scope d= ev "${IFACE}" $valid_lft $preferred_lft $home $nodad + # This must appear on a single line, continuations cannot be used + set -- "${address}${netmask}" ${peer:+peer} ${peer} ${broadcast:+broadc= ast} ${broadcast} ${anycast:+anycast} ${anycast} ${label:+label} ${label}= ${scope:+scope} ${scope} dev "${IFACE}" ${valid_lft:+valid_lft} $valid_l= ft ${preferred_lft:+preferred_lft} $preferred_lft $confflaglist veinfo ip addr add "$@" ip addr add "$@" }