[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Issues found by inetutils-ifconfig.

Quoting Mats Erik Andersson (2015-07-18 01:43:32)
> Dear Justus Winter!
> [CC s still in demand]
> Friday den 17 July 2015 klockan 16:30 skrev Justus Winter detta:
> > 
> > > For our common reference in this discussion, the structure populating
> > > call is ioctl(sfd, SIOCGIFHWADDR, &ifr), after which evaluation
> > > of `ifr.ifr_hwaddr.sa_family' should follow.
> > 
> > I can't find that in the inetutils source as packaged by Debian.
> > Furthermore, I cannot get ifconfig to do that ioctl:
> I have just committed code to our Git HEAD with system specific
> adaptions for GNU/Hurd, and according to your wish I have left
> out every work around mentioned here.

Nice.  I found it.

> This last statement is due to the missing value 772.

Yes.  I discovered something:

% gdb ifconfig
(gdb) print sizeof (struct sockaddr)
$1 = 16
(gdb) print sizeof ((struct sockaddr *)0)->sa_
sa_data    sa_family  sa_len
(gdb) print sizeof ((struct sockaddr *)0)->sa_family
$2 = 1

But it's the same in our pfinet server, so the trunctation happens
there, I just checked.  So the definition must come from the glibc,
but the glibc is notoriously good at hiding the right declarations
from me...

I'm not sure what the right thing to do is.


Reply to: