[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in gdomap under FreeBSD - solved
From: |
Pete French |
Subject: |
Bug in gdomap under FreeBSD - solved |
Date: |
Fri, 25 Jan 2002 12:31:21 +0000 |
O.K. I found the bug in gdomap that was causing me all my problems.
The code for line 1123 onwars assumes that the ifreq structures in the
data returned by SIOCGIFCONF all have the same size and that this
size is equal to sizeof(struct ifreq).
This is not the case as an ifreq structure contains a struct sockaddr,
which may be of variable size. From the netintro(4) man page...
struct sockaddr {
u_char sa_len;
u_char sa_family;
char sa_data[14];
};
The field sa_len contains the total length of the structure, which may
exceed 16 bytes.
This is what is causing this loop to obtain corrupt interface names on
my BSD systesm, and it is merely a matter of luck if it hits lo0. The
loop needs altering to take account of the variable length as it steps
through the interfaces.
I am going to have a go at fixing this, is the approrpiate place for patches
to go disuss orbug-gnustep ?
cheers,
-bat.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Bug in gdomap under FreeBSD - solved,
Pete French <=