From 0888f74f473f3e4b83de5f04b0b4cbb4b8dbc7f9 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 8 May 2007 16:52:26 +0000 Subject: When we don't have an address return 1, #176577. --- ChangeLog | 4 ++++ net.BSD/ifconfig.sh | 3 ++- net.Linux/ifconfig.sh | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b7a3ebbd..6840a712 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for Gentoo System Intialization ("rc") scripts # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2 + 08 May 2007; Roy Marples : + + When we don't have an address return 1, #176577. + 05 May 2007; Roy Marples : Fix KV_to_int working with funky kernel versions, #177197. diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh index 2e88bc20..bfc10055 100644 --- a/net.BSD/ifconfig.sh +++ b/net.BSD/ifconfig.sh @@ -51,9 +51,10 @@ _is_wireless() { _get_inet_address() { set -- $(LC_ALL=C ifconfig "${IFACE}" | sed -n -e 's/^[[:space:]]*inet \([^ ]*\) netmask 0x\(..\)\(..\)\(..\)\(..\).*/\1 0x\2.0x\3.0x\4/p') + [ -z "$1" ] && return 1 + echo -n "$1" shift - echo "/$(_netmask2cidr "$1")" } diff --git a/net.Linux/ifconfig.sh b/net.Linux/ifconfig.sh index 68590bbe..0bd5da29 100644 --- a/net.Linux/ifconfig.sh +++ b/net.Linux/ifconfig.sh @@ -61,6 +61,8 @@ _set_mac_address() { _get_inet_address() { set -- $(LC_ALL=C ifconfig "${IFACE}" | sed -n -e 's/.*inet addr:\([^ ]*\).*Mask:\([^ ]*\).*/\1 \2/p') + [ -z "$1" ] && return 1 + echo -n "$1" shift echo "/$(_netmask2cidr "$1")" -- cgit v1.2.3