IPv6 broken on Linux-2.4

From: Felix von Leitner (leitner@codeblau.de)
Date: Tue Jul 18 2000 - 12:38:34 EST


There are several problems with IPv6 in Linux. First of all, the kernel
started to reject attempts to send packets to link-local addresses
with scope_id not specified or 0 in sockaddr_in6.

Unfortunately, glibc does not define the scope_id field.

So I defined my own struct sockaddr_in6 and used that, but one of my
programs needs to connect to a link-local address that was the source
address of a received UDP packet.

The obvious solution is to use the scope_id from the received UDP
packet. The UDP packets are sent using IPv6 multicast UDP. Now, when
the UDP packets are received on the same host that sent them, Linux
incorrectly sets the scope_id (i.e. the interface number) to 3 (lo)
instead of 4 (eth0), although the multicast packets only show up on
eth0.

The result is that my program tries to connect to the link-local address
BUT ON THE lo INTERFACE, which knows only ::1 and not
fe80::260:67ff:fe33:d15b and thus connect fails with "connection
refused".

To sum it up, the Linux bug is to return the wrong interface when
receiving UDP packets sent from the local host.

I detected this on linux 2.4.0-test4, but I suspect that this conceptual
bug is in other versions, too.

BTW: ping6 and the other user-space IPv6 utilities were broken by the
scope_id change, too. Right now there is no version of ping that I know
that can be used to ping your own link-local address.

Felix

PS: If someone needs to compile the new pcap-0.5 and tcpdump-3.5 from
http://www.tcpdump.org/ with IPv6 support under Linux, you can find my
patches at http://www.fefe.de/.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 23 2000 - 21:00:11 EST