summaryrefslogtreecommitdiff
path: root/net.BSD
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-05-08 16:52:26 +0000
committerRoy Marples <roy@marples.name>2007-05-08 16:52:26 +0000
commit0888f74f473f3e4b83de5f04b0b4cbb4b8dbc7f9 (patch)
treeef0ebfed96315be4906b1b4dd6c19ca919fbba8d /net.BSD
parentea28d7e78d5155b46bf76b3e95109666db0ef0ba (diff)
downloadopenrc-0888f74f473f3e4b83de5f04b0b4cbb4b8dbc7f9.tar.gz
openrc-0888f74f473f3e4b83de5f04b0b4cbb4b8dbc7f9.tar.bz2
openrc-0888f74f473f3e4b83de5f04b0b4cbb4b8dbc7f9.tar.xz
When we don't have an address return 1, #176577.
Diffstat (limited to 'net.BSD')
-rw-r--r--net.BSD/ifconfig.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/net.BSD/ifconfig.sh b/net.BSD/ifconfig.sh
index 2e88bc2..bfc1005 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")"
}