From: Enrico Scholz Date: Fri, 21 Jan 2005 13:41:24 +0000 (+0000) Subject: * interface-configuration: accept 'nodev' without a configured 'dev'; X-Git-Tag: IPSENTINEL_VERSION_0_12~208 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=443f71da4f048b1d8bfea89bb381ef015bf611db;p=util-vserver.git * interface-configuration: accept 'nodev' without a configured 'dev'; formerly the interface was silently ignored when 'dev' was missing * added some sanity checks for the behaviour described above git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1786 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/scripts/vserver.functions b/util-vserver/scripts/vserver.functions index 0cf1ad1..4f39eff 100644 --- a/util-vserver/scripts/vserver.functions +++ b/util-vserver/scripts/vserver.functions @@ -453,14 +453,18 @@ function _processSingleInterface _getInterfaceValue mac '' "$iface" test "$ip" || { echo $"Can not read ip for '$iface'" >&2; return 1; } + test "$dev" -o -e "$iface"/nodev || { + echo $"No device specified for '$iface'" >&2 + return 1; + } - test ! -e "$iface"/down || up= - - while test "$dev"; do + test ! -e "$iface"/down || up= + + while true; do _transformMask2Prefix prefix "$prefix" "$mask" INTERFACES=( "${INTERFACES[@]}" "$ip${prefix:+/$prefix}" ) - test ! -e "$iface"/nodev || break + test ! -e "$iface"/nodev || break test ! -e "$iface"/only_ip || { ## LEGACY ALERT echo $"The 'only_ip' flag for interface '$iface' is deprecated; use 'nodev' instead of" >&2