]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- support $IPADDR + $NETMASK combination if no prefix in $IPADDR present
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 1 Oct 2007 08:45:51 +0000 (08:45 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Mon, 1 Oct 2007 08:45:51 +0000 (08:45 +0000)
svn-id: @8768

sysconfig/network-scripts/functions.network

index 7754d73cd5148b206899a68600bf09c1da6a38c4..f4cc42f61e51dc4115905568f55fc3d4086bf717 100644 (file)
@@ -196,7 +196,13 @@ setup_ip_param ()
        DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
 
        eval IP4ADDR="\$IPADDR${IP4_PRIM_IF:-}"
-       if echo "${IP4ADDR}" | grep -q ":" ; then
+       # check if ipaddr doesn't contain network length -- use $NETMASK then
+       if [[ "$IP4ADDR" != */* ]] && [ "$NETMASK" ]; then
+               IP4ADDR=$IP4ADDR/$(calcprefix $NETMASK)
+       fi
+
+       # check if we have ipv6 or ipv4 address
+       if [[ "${IP4ADDR}" = *:* ]]; then
                IP6ADDR=${IP4ADDR}
                IP4ADDR=""
        else
This page took 0.0912 seconds and 4 git commands to generate.