bug-gnustep
[Top][All Lists]
Advanced

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

Re: gdomap bug - patch


From: Richard Frith-Macdonald
Subject: Re: gdomap bug - patch
Date: Fri, 25 Jan 2002 20:31:25 +0000

On Friday, January 25, 2002, at 01:26 PM, Pete French wrote:

The patch below fixes a problem in gdomap which causes it to read an
incorrect list of interfaces under FreeBSD and other 4.4 BSD systems.
The bug is caused by the fact that SIOCGIFCONF returs a set of variable length
data structures rather than a set of sixed length struct ifconf's.

The patch changes the code to step through the list by pointer uusing
a void* that ismoved on by the truelength of the structure. As a side effect of this wedo not know the number of interfaces we shall have in advance and thus
the malloc for the space has been altered to always use MAX_IFACE.

The resulting list of interfaces is now correct and work in FreeBSD. This
showed up an additional warning in that SIOCGIFBRDDR is being called on
loopback interfaces. The patch adds a flag to test for this and hence not
make the call on loopback interfaces. This removes these warnings.

Thanks ... I added your patch with a slight modification and all the
associated autoconf stuff to decide whether the system has variable length data structures with an sa_length field or not ... presumably only the recent
BSDs do (certainly linux doesn't).
Please check it out from CVS and see if I've got it right ... I don't have
a BSD system to test on.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]