cvs commit: src/etc devd.conf network.subr pccard_ether src/etc/defaults rc.conf src/etc/rc.d dhclient netif

Andrea Campi andrea+freebsd_cvs_all at webcom.it
Tue Jun 7 22:50:13 GMT 2005


Hi,


On Tue, Jun 07, 2005 at 04:49:12AM +0000, Brooks Davis wrote:
> brooks      2005-06-07 04:49:12 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     etc                  devd.conf network.subr pccard_ether 
>     etc/defaults         rc.conf 
>     etc/rc.d             dhclient netif 
>   Log:
>   Support code for the OpenBSD dhclient.  This significantly changes the
>   way interfaces are configured.  Some key points:

things broke badly for me on a plain-vanilla installation. I don't have
an easy way to test a proper solution right now, but there are a couple
things that stick out as suspiciously bogus:

> ===================================================================
> RCS file: /usr/local/www/cvsroot/FreeBSD/src/etc/network.subr,v
> retrieving revision 1.160
> retrieving revision 1.161
> diff -u -p -r1.160 -r1.161
> --- src/etc/network.subr	2004/12/05 21:45:36	1.160
> +++ src/etc/network.subr	2005/06/07 04:49:11	1.161
> @@ -34,16 +34,30 @@
>  #	Evaluate ifconfig(8) arguments for interface $if and
>  #	run ifconfig(8) with those arguments. It returns 0 if
>  #	arguments were found and executed or 1 if the interface
> -#	had no arguments.
> +#	had no arguments.  Pseudo arguments DHCP and WPA are handled
> +#	here.
>  #
>  ifconfig_up()
>  {
> -	eval ifconfig_args=\$ifconfig_$1
> +	_cfg=1
> +
> +	ifconfig_args=`ifconfig_getargs $1`
>  	if [ -n "${ifconfig_args}" ]; then
>  		ifconfig $1 ${ifconfig_args}
> -		return 0
> +		_cfg=0
>  	fi
> -	return 1
> +
> +	if wpaif $1; then
> +		#/etc/rc.d/wpa_supplicant start $1
> +		_cfg=0		# XXX: not sure this should count
> +	fi
> +
> +	if dhcpif $1; then
> +		/etc/rc.d/dhclient start $1
> +		_cfg=0
> +	fi
> +
> +	return ${cfg}

Shouldn't this be $_cfg ?

> @@ -74,7 +88,96 @@ ifconfig_down()
>  	done
>  	IFS="$oldifs"
>  
> +	if wpaif $1; then
> +		#/etc/rc.d/wpa_supplicant stop $1
> +	fi
> +
> +	if dhcpif $1; then
> +		/etc/rc.d/dhclient stop $1
> +		_cfg=0
> +	fi
> +
>  	return $_ret
> +}

Ditto.

Bye,
	Andrea

-- 
      ...and that is how we know the Earth to be banana-shaped.


More information about the cvs-src mailing list