From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-536838-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 6EAFF1381F3
	for <garchives@archives.gentoo.org>; Thu, 20 Dec 2012 22:05:42 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E12B8E0660;
	Thu, 20 Dec 2012 22:05:34 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 6685FE0660
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Dec 2012 22:05:34 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 68B5633D8FB
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Dec 2012 22:05:33 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 965FCE543C
	for <gentoo-commits@lists.gentoo.org>; Thu, 20 Dec 2012 22:05:30 +0000 (UTC)
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" <williamh@gentoo.org>
Message-ID: <1356040931.a61fdd019ee8715689ce07abeda25e6961a4754f.WilliamH@OpenRC>
Subject: [gentoo-commits] proj/openrc:master commit in: init.d/
X-VCS-Repository: proj/openrc
X-VCS-Files: init.d/net.lo.in
X-VCS-Directories: init.d/
X-VCS-Committer: WilliamH
X-VCS-Committer-Name: William Hubbs
X-VCS-Revision: a61fdd019ee8715689ce07abeda25e6961a4754f
X-VCS-Branch: master
Date: Thu, 20 Dec 2012 22:05:30 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: a6d46244-9310-428d-91f3-129b4a423d8a
X-Archives-Hash: e4ff4a2be51968412dbba427dc523971

commit:     a61fdd019ee8715689ce07abeda25e6961a4754f
Author:     Mihai Moldovan <ionic <AT> ionic <DOT> de>
AuthorDate: Thu Dec 20 22:02:11 2012 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Dec 20 22:02:11 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=a61fdd01

net.lo: allow address families to be set on routes

X-Gentoo-Bug: 447310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?d=447310

---
 init.d/net.lo.in |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/init.d/net.lo.in b/init.d/net.lo.in
index 51833f2..db6550d 100644
--- a/init.d/net.lo.in
+++ b/init.d/net.lo.in
@@ -650,12 +650,19 @@ ${routes}"
 
 	local OIFS="${IFS}" SIFS="${IFS-y}"
 	local IFS="$__IFS"
+	local fam
 	for cmd in ${routes}; do
 		unset IFS
 		if ${first}; then
 			first=false
 			einfo "Adding routes"
 		fi
+
+		case ${cmd} in
+			-6" "*) fam="-6"; cmd=${cmd#-6 };;
+			-4" "*) fam="-4"; cmd=${cmd#-4 };;
+		esac
+
 		eindent
 		ebegin ${cmd}
 		# Work out if we're a host or a net if not told
@@ -668,10 +675,10 @@ ${routes}"
 			*)                                 cmd="-host ${cmd}";;
 		esac
 		if ${hidefirstroute}; then
-			_add_route ${cmd} >/dev/null 2>&1
+			_add_route ${fam} ${cmd} >/dev/null 2>&1
 			hidefirstroute=false
 		else
-			_add_route ${cmd} >/dev/null
+			_add_route ${fam} ${cmd} >/dev/null
 		fi
 		eend $?
 		eoutdent