netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [quagga-users 1301] Re: ospf6 on 2.6.x linux kernel - IN6_IS_ADDR_LINKLOCAL - fe80::/128
       [not found] ` <20031225132805.GA26914-5f0Gu3/Ff3Io5WaTebH86Dgy8vVj6WhI@public.gmane.org>
@ 2004-01-16 15:59   ` David Lamparter
  0 siblings, 0 replies; only message in thread
From: David Lamparter @ 2004-01-16 15:59 UTC (permalink / raw)
  To: Lukasz Biegaj, glibc bugs, quagga-users, quagga-dev, netdev

[-- Attachment #1: Type: text/plain, Size: 3459 bytes --]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Lukasz Biegaj wrote:
| Is there a way to make OSPF6 work on 2.6.x linux kernels?
|
| Currently I see this in logs:
| 2003/12/24 11:23:13 OSPF6: LSA: originate [AS-External ID=0.0.0.9
Adv=80.55.247.118] seq: 0x80000001 age: 0
| 1072261393.983434
| 2003/12/24 11:23:13 OSPF6: ASBR: start redistributing 2000::/3 as
LS-ID 10: 1072261393.983804
| 2003/12/24 11:23:13 OSPF6: ASBR: schedule redistribution 2000::/3 as
LS-ID 10 after 0 sec
| 2003/12/24 11:23:13 OSPF6: LSA: originate [AS-External ID=0.0.0.10
Adv=80.55.247.118] seq: 0x80000001 age: 0
| 1072261393.983985
| 2003/12/24 11:23:14 OSPF6: Network: Join AllDRouters on ifindex 4
| 2003/12/24 11:23:14 OSPF6: Network: sendmsg (ifindex: 4) failed:
Invalid argument(22)
[...]
| Linux 2.6.0, Debian SID, quagga from apt.
|

we ran into the same problem and found this:

* Linux 2.6 seems to list all multicast / anycast adresses together with
unicast addresses:

[equinox-Fynnp5iTXxOlVyrhU4qvOw@public.gmane.org]:~ # ip a l dc2
9: dc2-eEeg5gueQ+g@public.gmane.org: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1460 qdisc noqueue
~    link/gre 0.0.0.0 peer 217.82.189.49
~    inet 172.22.24.1 peer 172.22.2.2/32 scope global dc2
~    inet6 fe80::ac17:2402/64 scope link
~       valid_lft forever preferred_lft forever
~    inet6 ff02::5/128 scope global
~       valid_lft forever preferred_lft forever
~    inet6 ff02::1/128 scope global
~       valid_lft forever preferred_lft forever
~    inet6 fe80::/128 scope global
~       valid_lft forever preferred_lft forever
(note the 2nd last line)

* ospf6d uses the address list for selecting a linklocal address with
IN6_IS_ADDR_LINKLOCAL
(quagga/ospf6d/ospf_interface.c:192)

~      /* linklocal scope check */
~      if (IN6_IS_ADDR_LINKLOCAL (&c->address->u.prefix6))
~        l = &c->address->u.prefix6;

* IN6_IS_ADDR_LINKLOCAL is defined in /usr/include/netinet/in.h:307 as
follows:

#define IN6_IS_ADDR_LINKLOCAL(a) \
~        ((((__const uint32_t *) (a))[0] & htonl (0xffc00000)) \
~         == htonl (0xfe800000))

* in conjunction with 2.6 reporting all multicast/anycast addresses,
this gets fe80:: (all-routers as far as i remember) into the OSPF6
interface, but the kernel will reject this (of course...):

~  OSPF6: Network: sendmsg (ifindex: 9) failed: Invalid argument(22)


I don't know whose fault it is (how is IN6_IS_ADDR_LINKLOCAL defined to
work? Is it OK for the kernel to include anycast/multicast addresses?)
but this breaks ospf6d. Our fix was to change netinet/in.h because
IN6_IS_ADDR_LINKLOCAL returning !0 only for unicast addresses seemed to
be "the right thing". Patch attached. (categorize that patch as "dirty
works-for-me hack")

David Lamparter


P.S.: glibc people please Cc me, i'm only subscribed to netdev and quagga-*

System environment:
Linux Kernel 2.6.1, x86, non-SMP, preemptible, vanilla
GNU C Library stable release version 2.3.2, by Roland McGrath et al.
quagga 0.96.4 CVS (Fre Jan 16 16:43:35 CET 2004)
gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)

- --
A0C21986 David Lamparter (equinox) <david.lamparter-zqRNUXuvxA0b1SvskN2V4Q@public.gmane.org>
2D7F 5CC6 93AD 38DD 6CD5  47A0 A5F0 4657 A0C2 1986
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFACAplpfBGV6DCGYYRAlQ9AJ44NbGi+WCVsMiCqq7Sklg7cKq1GQCePAjn
QK+iNxE0JP+rdar7H3Ceapw=
=QdyO
-----END PGP SIGNATURE-----

[-- Attachment #2: glibc-ipv6-is_linklocal.patch --]
[-- Type: text/plain, Size: 533 bytes --]

--- usr/include/netinet/in.h.prelinklocalfix	2004-01-16 15:58:53.000000000 +0100
+++ usr/include/netinet/in.h	2004-01-16 16:54:31.501509680 +0100
@@ -306,7 +306,9 @@
 
 #define IN6_IS_ADDR_LINKLOCAL(a) \
 	((((__const uint32_t *) (a))[0] & htonl (0xffc00000))		      \
-	 == htonl (0xfe800000))
+	 == htonl (0xfe800000)						      \
+	&& ((((__const uint32_t *) (a))[2]) != 0			      \
+	|| (((__const uint32_t *) (a))[3]) != 0))
 
 #define IN6_IS_ADDR_SITELOCAL(a) \
 	((((__const uint32_t *) (a))[0] & htonl (0xffc00000))		      \

[-- Attachment #3: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Quagga-users mailing list
Quagga-users-UOy77sIEA+cAd7ICUelF/Q@public.gmane.org
http://lists.quagga.net/mailman/listinfo/quagga-users

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-01-16 15:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20031225132805.GA26914@cytrynka.infoland.int.pl>
     [not found] ` <20031225132805.GA26914-5f0Gu3/Ff3Io5WaTebH86Dgy8vVj6WhI@public.gmane.org>
2004-01-16 15:59   ` [quagga-users 1301] Re: ospf6 on 2.6.x linux kernel - IN6_IS_ADDR_LINKLOCAL - fe80::/128 David Lamparter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).