Subject: Re: Question regarding ifconfig.
To: Shankar Agarwal <shankar_agarwal@net.com>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 04/19/2001 17:55:08
On Wed, Apr 18, 2001 at 06:31:07PM -0700, Shankar Agarwal wrote:
> I have a doubt about the ifconfig file. when i am trying to configure or
> change ip address on the interface. The main calls setifaddr function
> which calls ioctl function with command as SIOCGIFADDR by the following
> lines

I think that you are misunderstanding "setifaddr".  You might think that
this function actually does the work of setting the interface address.
It doesn't.  It does, however, set a variable called "newaddr" and check
to see if an address is already defined for the interface.  If an
address is already defined, then it sets the "clearaddr" variable.  Both
"newaddr" and "clearaddr" are used in main().  Search for all uses of
those two variables and you might find a little more clarity...

-allen

-- 
 Allen Briggs                     briggs@wasabisystems.com
 http://www.wasabisystems.com/    Quality NetBSD CDs, Sales, Support, Service
NetBSD dev. for _your_ Alpha, ARM, M68K, MIPS, PowerPC, SH3, Sparc, x86, etc...