summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-08-12 10:22:40 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-08-12 10:22:40 +0200
commitdcc71a7fb7e507acc2e0b417e6c9d1940448908e (patch)
treeab8114caa2c88494811868e67de7c4d3e8a293f6 /lib
parent0ef69b1c4a255360e1fa76dffd7a0cb97ea1e9dc (diff)
downloadbird-dcc71a7fb7e507acc2e0b417e6c9d1940448908e.tar
bird-dcc71a7fb7e507acc2e0b417e6c9d1940448908e.zip
Supports unique local unicast addresses.
Diffstat (limited to 'lib')
-rw-r--r--lib/ipv6.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ipv6.c b/lib/ipv6.c
index 88c54eb..7c28c48 100644
--- a/lib/ipv6.c
+++ b/lib/ipv6.c
@@ -67,13 +67,15 @@ ipv6_classify(ip_addr *a)
{
u32 x = a->addr[0];
- if ((x & 0xe0000000) == 0x20000000) /* Aggregatable Global Unicast Address */
+ if ((x & 0xe0000000) == 0x20000000) /* 2000::/3 Aggregatable Global Unicast Address */
return IADDR_HOST | SCOPE_UNIVERSE;
- if ((x & 0xffc00000) == 0xfe800000) /* Link-Local Address */
+ if ((x & 0xffc00000) == 0xfe800000) /* fe80::/10 Link-Local Address */
return IADDR_HOST | SCOPE_LINK;
- if ((x & 0xffc00000) == 0xfec00000) /* Site-Local Address */
+ if ((x & 0xffc00000) == 0xfec00000) /* fec0::/10 Site-Local Address */
return IADDR_HOST | SCOPE_SITE;
- if ((x & 0xff000000) == 0xff000000) /* Multicast Address */
+ if ((x & 0xfe000000) == 0xfc000000) /* fc00::/7 Unique Local Unicast Address (RFC 4193) */
+ return IADDR_HOST | SCOPE_SITE;
+ if ((x & 0xff000000) == 0xff000000) /* ff00::/8 Multicast Address */
{
unsigned int scope = (x >> 16) & 0x0f;
switch (scope)