View | Details | Raw Unified | Return to bug 3695
Collapse All | Expand All

(-)net-scripts-0.3-orig/README (-1 / +3 lines)
Lines 202-208 Link Here
202
    GATEWAY=
202
    GATEWAY=
203
    ONBOOT=yes|no
203
    ONBOOT=yes|no
204
    USERCTL=yes|no
204
    USERCTL=yes|no
205
    BOOTPROTO=none|bootp|dhcp
205
    BOOTPROTO=none|(bootp|dhcp|zcip)[,zcip]
206
    DHCP_CLIENT=
206
    DHCP_CLIENT=
207
    MTU=
207
    MTU=
208
    PEERDNS=yes|no
208
    PEERDNS=yes|no
Lines 212-217 Link Here
212
      provide DNS addresses that are dropped into the resolv.conf
212
      provide DNS addresses that are dropped into the resolv.conf
213
      file if PEERDNS is not set to "no".
213
      file if PEERDNS is not set to "no".
214
214
215
  BOOTPROTO can contain more than one comma-separated value,
216
  in latter case first succeeded method stops further attempts.
215
  If BOOTPROTO is not "none", then the only other item that
217
  If BOOTPROTO is not "none", then the only other item that
216
  must be set is the DEVICE item; all the rest will be determined
218
  must be set is the DEVICE item; all the rest will be determined
217
  by the boot protocol.  No "dummy" entries need to be created.
219
  by the boot protocol.  No "dummy" entries need to be created.
(-)net-scripts-0.3-orig/sysconfig/network-scripts/ifup (-3 / +29 lines)
Lines 58-63 Link Here
58
	"$SBIN_IWCONFIG" ${DEVICE} enc "$WIRELESS_ENC_KEY" >/dev/null 2>&1
58
	"$SBIN_IWCONFIG" ${DEVICE} enc "$WIRELESS_ENC_KEY" >/dev/null 2>&1
59
fi
59
fi
60
60
61
IFS=, read BOOTPROTO BOOTPROTO_FALLBACK <<< "$BOOTPROTO"
62
61
if [ "$BOOTPROTO" = dhcp ]; then
63
if [ "$BOOTPROTO" = dhcp ]; then
62
    DYNCONFIG=true
64
    DYNCONFIG=true
63
fi
65
fi
Lines 213-219 Link Here
213
if [ -n "$DHCP_CLIENT" ]; then
215
if [ -n "$DHCP_CLIENT" ]; then
214
case "${DHCP_CLIENT##*/}" in
216
case "${DHCP_CLIENT##*/}" in
215
	dhcpcd)
217
	dhcpcd)
216
		[ -z "$DHCP_HOSTNAME" ] || DHCP_ARGS="-h $DHCP_HOSTNAME"
218
		[ -z "BOOTPROTO_FALLBACK" ] || DHCP_ARGS="-t 30"
219
		[ -z "$DHCP_HOSTNAME" ] || DHCP_ARGS="$DHCP_ARGS -h $DHCP_HOSTNAME"
217
		[ -z "$NEEDHOSTNAME" ] || DHCP_ARGS="$DHCP_ARGS -H"
220
		[ -z "$NEEDHOSTNAME" ] || DHCP_ARGS="$DHCP_ARGS -H"
218
		is_yes "$PEERNTP" || DHCP_ARGS="$DHCP_ARGS -N"
221
		is_yes "$PEERNTP" || DHCP_ARGS="$DHCP_ARGS -N"
219
		! is_no "$PEERDNS" || DHCP_ARGS="$DHCP_ARGS -R"
222
		! is_no "$PEERDNS" || DHCP_ARGS="$DHCP_ARGS -R"
Lines 232-253 Link Here
232
		DHCP_ARGS="$DHCP_ARGS -w $DEVICE"
235
		DHCP_ARGS="$DHCP_ARGS -w $DEVICE"
233
		;;
236
		;;
234
	dhclient)
237
	dhclient)
238
		# We should limit dhclient activity to first try
239
		# if we have fallback method
240
		[ -z "BOOTPROTO_FALLBACK" ] || DHCP_ARGS="-1"
235
		# Can't specify a host with dhclient ? same remark for
241
		# Can't specify a host with dhclient ? same remark for
236
		# $NEEDHOSTNAME this client suck !!!
242
		# $NEEDHOSTNAME this client suck !!!
237
		DHCP_ARGS="$DEVICE"
243
		DHCP_ARGS="$DHCP_ARGS $DEVICE"
238
		;;
244
		;;
239
esac
245
esac
240
fi
246
fi
241
247
248
ZCIP=/sbin/zcip
249
ZCIP_ARGS"-s -i $DEVICE"
250
242
if [ -n "$DYNCONFIG" ]; then
251
if [ -n "$DYNCONFIG" ]; then
243
    echo -n "Determining IP information for $DEVICE via ${DHCP_CLIENT##*/}..."
252
    echo -n "Determining IP information for $DEVICE via ${DHCP_CLIENT##*/}..."
244
    if $DHCP_CLIENT $DHCP_ARGS; then
253
    if $DHCP_CLIENT $DHCP_ARGS; then
245
	echo " done."
254
	echo " done."
255
    elif [ "$BOOTPROTO_FALLBACK" = zcip ]; then
256
	echo 
257
	echo -n "Determining IP information for $DEVICE via ${ZCIP##*/}..."
258
	if $ZCIP $ZCIP_ARGS; then
259
	    echo " done."
260
	else
261
	    echo " failed."
262
	    exit 1
263
	fi
246
    else
264
    else
247
	echo " failed."
265
	echo " failed."
248
	exit 1
266
	exit 1
249
    fi
267
    fi
250
else 
268
elif [ "BOOTPROTO" = zcip ]; then
269
    echo -n "Determining IP information for $DEVICE via ${ZCIP##*/}..."
270
    if $ZCIP $ZCIP_ARGS; then
271
	echo " done."
272
    else 
273
	echo " failed."
274
	exit 1
275
    fi
276
else
251
    if [ -z "$NETMASK" ]; then
277
    if [ -z "$NETMASK" ]; then
252
	eval `/bin/ipcalc --netmask "$IPADDR"`
278
	eval `/bin/ipcalc --netmask "$IPADDR"`
253
    fi
279
    fi

Return to bug 3695