Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Jul 2001 15:11:39 -0400
From:      Peter Radcliffe <pir@pir.net>
To:        freebsd-mobile@freebsd.org
Subject:   ifconfig wireless card options and DHCP
Message-ID:  <20010707151139.A27611@pir.net>

next in thread | raw e-mail | index | archive | help
I noticed that the ifconfig changes for media options and for wireless
card configuration ahve gone into -stable, been playing with them with
my cisco 350 card and they seem to work well.

Currently for setting the wireless card options I use a bunch of hacks
to /etc/pccard_ether and lots of *control calls, but it would be nicer
if these could now be done with ifconfig in one call.

Seems like this would be easy currently for non-DHCP configured
interfaces, but as soon as you specify DHCP in $ifconfig_${interface}
you lose the ability to pass further arguments. In my opinion setting
up some media options before DHCP is called could be generally useful
with cards that need something to be forced before they will pass
packets at all (such as 802.11b with WEP enabled).

Looking at /etc/pccard_ether is looks like this patch would allow
you to do things like:

  ifconfig_an0="DHCP wepmode on wepkey ThisIsAKey"

I also added in a check for pccard_ether.local, since there are things
I do at every interface up/down and I'd rather not keep maintaining
changes between my pccard_ether script and the standard ones.

What do people think ?

P.

----------------------------------------------------------------------
*** /etc/pccard_ether.orig	Sat Jul  7 13:17:54 2001
--- /etc/pccard_ether	Sat Jul  7 15:10:28 2001
***************
*** 66,75 ****
--- 66,91 ----
  	case ${ifconfig_args} in
  	[Nn][Oo] | '')
  		;;
+ 
+ 	[Dd][Hh][Cc][Pp][\ \	]*)
+ 		# Do we have ifconfig arguments to do before we DHCP
+ 		# the interface ?
+ 		dhcp_ifconfig_args=`echo "${ifconfig_args}" \
+ 				    | sed 's/^[Dd][Hh][Cc][Pp][\ \	]*//'`
+ 
+ 		if [ "x$dhcp_ifconfig_args" != "x" ]; then
+   		  ifconfig ${interface} ${dhcp_ifconfig_args} $*
+ 		fi
+ 
+ 		# Start up the DHCP client program
+ 		start_dhcp
+ 		;;
+ 
  	[Dd][Hh][Cc][Pp])
  		# Start up the DHCP client program
  		start_dhcp
  		;;
+ 
  	*)
  		# Do the primary ifconfig if specified
  		ifconfig ${interface} ${ifconfig_args} $*
***************
*** 183,185 ****
--- 199,205 ----
  	esac
  	;;
  esac
+ 
+ if [ -x "$pccard_ether_local" ]; then
+ 	$pccard_ether_local $interface $startstop $@
+ fi
----------------------------------------------------------------------

-- 
pir                  pir@pir.net                    pir@net.tufts.edu


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010707151139.A27611>