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

Re: Issues found by inetutils-ifconfig.



Onsdagen den 29:e juli 2015 klockan 21:57 skrev Samuel Thibault detta:
> Justus Winter, le Sat 18 Jul 2015 03:21:18 +0200, a écrit :
> >
> > (gdb) print sizeof ((struct sockaddr *)0)->sa_family
> > $2 = 1
> 
> Yes, on BSD, sa_family_t is an unsigned char.
> 
> > 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...
> 
> It's coming from ./sysdeps/mach/hurd/bits/socket.h which uses
> __SOCKADDR_COMMON from sysdeps/unix/bsd/bits/sockaddr.h
> 
> So we're basically screwed: sa_family can't have values beyond 255.
> That's the issue with using Linuxish values in pfinet while GNU/Hurd
> usually uses BSD interfaces...

A very interesting observation! I will account for this by
applying a bitmask to the macros ARPHRD_* in the GNU/Hurd
specific code of our 'ifconfig' implementation. This will
display the loopback interface correctly.

Thanks go to both of you for clarifying this situation.

Best regards,
  Mats Erik Andersson, on behalf of GNU Inetutils.


Reply to: