Re: SIOCGIFADDR bug?

really kuznet@ms2.inr.ac.ru (inr-linux-kernel@ms2.inr.ac.ru)
18 Jun 1996 20:53:59 +0400


Zachary Roger Amsden (amsden+@andrew.cmu.EDU) wrote:

: The ioctl call SIOCGIFADDR, when used to get the internet addresss of an
--------
: interface, behaves erradically.
.....
: now, addr.sin_addr.s_addr should be the encoded ethernet address,
--------

Did you specify disired address family?
You program will get hardware ethernet address.
If you want internet address, write ifr.ifr_addr.sa_family = AF_INET.

Alexey Kuznetsov.