Date: Thu, 19 Apr 2001 14:08:54 -0700 (PDT) From: Bill Studenmund <wrstuden@zembu.com> To: Shankar Agarwal <shankar_agarwal@net.com> Cc: tech-kern@netbsd.org, bsd hackers <freebsd-hackers@FreeBSD.ORG> Subject: Re: Question regarding ifconfig. Message-ID: <Pine.NEB.4.21.0104191404130.823-100000@candlekeep.home-net.internetconnect.net> In-Reply-To: <3ADE3FDB.E082BC69@net.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Apr 2001, Shankar Agarwal wrote: > Hi All, First off, you have sent mail to two different *BSD groups. While we have a common history and share features back and forth over time, you really should limit this message to the group from which you are using code. > 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 > ifr->ifr_addr.sa_family = afp->af_af; > if (ioctl(s, afp->af_gifaddr, afp->af_ridreq) == 0) > clearaddr = 1; > Now i don't understand why the ioctl is called by SIOCGIFADDR when i am > configuring an ip address on the interface. Moreover i believe that when That's because that ioctl is not adding the new address, it is looking to see if there is an existing one. > ioctl returns successfully it returns 0 so the clearaddr will be set and > later on the ip address will be deleted. Any existing IP address will be deleted. If there already is an address, you need to get rid of it before you can add/set the new one. > Please help me out if i am interpreting it wrong as i am not able to > assign an ip address to the interface in my ported code. At least in the NetBSD version, I think the action is in the code block right after the if (clearaddr) { }. That next block is the one which will set the address. Take care, Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.4.21.0104191404130.823-100000>