SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

glen glen at pld-linux.org
Mon Oct 1 10:45:51 CEST 2007


Author: glen
Date: Mon Oct  1 10:45:51 2007
New Revision: 8768

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- support $IPADDR + $NETMASK combination if no prefix in $IPADDR present

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==============================================================================
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network	(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.network	Mon Oct  1 10:45:51 2007
@@ -196,7 +196,13 @@
 	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


More information about the pld-cvs-commit mailing list