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

Bug#238936: [libc6] getifaddrs() fails to initialize ifaddrs.ifa_addr for PPP devices



Package: libc6
Version: 2.3.2.ds1-11
Severity: normal

Hello:

I was playing around with a Debian Sid box with kernel 2.6.4,
ipsec-tools 0.2.2-8, libc 2.3.2.ds1-11 and racoon 0.2.2-8 to make some
tests and suddenly I realized racoon was unable to start.

I have other box around here with the exact same kernel, libc6, racoon
and ipsec-tools version, and "racoon" starts normally. Different
hardware, but same software installed on both.

I started "racoon" in the foreground and was given a "SIGSEGV" error
message. Then I recompiled the Debian package to include debugging
information and uses "ddd" to debug the problem. After some time I found
the point where it fails, exactly at line 345 from src/racoon/grabmyaddr.c:

if (ifap->ifa_addr->sa_family != AF_INET

Using the pretty "display" option in "ddd" I peeked inside the "ifap"
ifaddrs structure, and realized that is a NULL pointer. So the second
indirection fails with the SIGSEGV error message.

The preceeding "for" loop iterates over a linked list of detected local
network interfaces, which was previously created by getifaddrs() libc
function issued at line 334 at the same source file. In my local setup
this linked list consists of structures for (and in this order) "lo",
"eth0", "sit0", "ppp0" and "dummy0" (and this last one links back to the
first in the list).

Well, it seems the _only_ node with a "ifa_addr" member not initialized
is that of "ppp0", that is a NULL pointer instead of one to a "sockaddr"
structure. The interface "dummy0" was added in a second test, just to
see if being the last node in the list had something to do with the
problem, but it doesn't seem so.

That is the only reason why "racoon" worked at one box, but not at the
other: the box where it fails has a PPP connection to the Internet and
the other doesn't. When the PPP interface is down, for example, at boot
time, the ppp0 interface doesn't exist, getifaddrs() gets all the other
interfaces, populates the structures correctly, and "racoon" starts ok.

So it seems there is some kind of problem with getifaddrs() in Debian
Sid libc6 2.3.2.ds1-11, or maybe in the Linux kernel, or some strange
interaction between the two.

I am going to try with some other kernel versions just in case, and
if you need it I can upload a couple of screenshots that show the linked
list of interfaces both with ppp0 up and without. Hope it helps.

Keep up the good work !

--
José Luis Domingo López
Linux Registered User #189436     Debian Linux Sid (Linux 2.6.4)



Reply to: