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

Re: Issues found by inetutils-ifconfig.

Justus Winter, le Sat 18 Jul 2015 03:21:18 +0200, a écrit :
> Quoting Mats Erik Andersson (2015-07-18 01:43:32)
> > 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

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...


Reply to: