Subject: Question regarding ifconfig.
To: <>
From: Shankar Agarwal <shankar_agarwal@net.com>
List: tech-kern
Date: 04/18/2001 18:31:07
Hi All,
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
ioctl returns successfully it returns 0 so the clearaddr will be set and
later on the ip address will be deleted.
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.
Thanks
Regards
Shankar