bug-glibc
[Top][All Lists]
Advanced

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

Re: [quagga-users 1193] ospf6 on 2.6.x linux kernel - IN6_IS_ADDR_LINKLO


From: David Lamparter
Subject: Re: [quagga-users 1193] ospf6 on 2.6.x linux kernel - IN6_IS_ADDR_LINKLOCAL - fe80::/128
Date: Fri, 16 Jan 2004 16:59:44 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.6a) Gecko/20031030

-----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:

address@hidden:~ # ip a l dc2
9: address@hidden: <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) <address@hidden>
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-----
--- 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))                 \

reply via email to

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