* [PATCH] IPv6: Fix broken anycast usage
@ 2003-07-12 8:13 Mika Liljeberg
2003-07-15 0:29 ` kuznet
0 siblings, 1 reply; 2+ messages in thread
From: Mika Liljeberg @ 2003-07-12 8:13 UTC (permalink / raw)
To: YOSHIFUJI Hideaki; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 1370 bytes --]
This is against 2.5.75.
The patch fixes several places where anycast addresses should be treated
equivalently with unicast addresses. In particular, this includes
tunnels and routes pointing to anycast addresses.
I modified ipv6_addr_type() to return IPV6_ADDR_UNICAST also for anycast
addresses. IPV6_ADDR_ANYCAST is now added as an additional flag when the
address is one of the known anycast addresses.
I looked very hard at neighbor discovery and didn't see anything that
needs to be changed, but you might want to have a second look. One small
difference is that ND will now also try respond to neighbor
solicitations coming from known anycast addresses (very unlikely). IMHO,
this doesn't need to be policed. In general, there is no reliable way to
check if a remote address is anycast, anyway. From RFC2461:
Note that an anycast address is syntactically
indistinguishable from a unicast address. Thus, nodes
sending packets to anycast addresses don't generally
know that an anycast address is being used. Throughout
the rest of this document, references to unicast
addresses also apply to anycast addresses in those
cases where the node is unaware that a unicast address
is actually an anycast address.
Thanks,
MikaL
[-- Attachment #2: 2.5.75-anycast.udiff --]
[-- Type: text/x-patch, Size: 799 bytes --]
diff -ur orig/linux-2.5.75/net/ipv6/addrconf.c linux-2.5.75/net/ipv6/addrconf.c
--- orig/linux-2.5.75/net/ipv6/addrconf.c 2003-07-10 23:14:49.000000000 +0300
+++ linux-2.5.75/net/ipv6/addrconf.c 2003-07-12 10:01:57.000000000 +0300
@@ -208,16 +208,15 @@
break;
};
return type;
- }
+ } else
+ type = IPV6_ADDR_UNICAST;
+
/* check for reserved anycast addresses */
-
if ((st & htonl(0xE0000000)) &&
((addr->s6_addr32[2] == htonl(0xFDFFFFFF) &&
(addr->s6_addr32[3] | htonl(0x7F)) == (u32)~0) ||
(addr->s6_addr32[2] == 0 && addr->s6_addr32[3] == 0)))
- type = IPV6_ADDR_ANYCAST;
- else
- type = IPV6_ADDR_UNICAST;
+ type |= IPV6_ADDR_ANYCAST;
/* Consider all addresses with the first three bits different of
000 and 111 as finished.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] IPv6: Fix broken anycast usage
2003-07-12 8:13 [PATCH] IPv6: Fix broken anycast usage Mika Liljeberg
@ 2003-07-15 0:29 ` kuznet
0 siblings, 0 replies; 2+ messages in thread
From: kuznet @ 2003-07-15 0:29 UTC (permalink / raw)
To: Mika Liljeberg; +Cc: netdev
Hello!
> this doesn't need to be policed. In general, there is no reliable way to
> check if a remote address is anycast, anyway. From RFC2461:
>
> Note that an anycast address is syntactically
> indistinguishable from a unicast address.
This is right. (Well, except for the fact that reserved anycasts
are very well syntactically distinguished. :-)) But this does not matter,
the patch is correct, ANYCAST is an additional attribute on unicast
addresses and it should be checked only in contexts where _this_ host
is a member of this anycast.
BTW it is an addendum to my previous mail. You were right complaining
about EINVAL for anycast nexthop. However:
Nexthop address is unique identifier of nexthop router. We do not enforce
this policy (see comments in route.c), hence it is bug to reject such routes
and you are right, but this does not make your example more reasonable.
Any non-unicast non-linklocal address used as nexthop is bad idea,
this policy is not enforced to allow use of global nexthops on BGP routers,
where it is convenient to use global addresses for nexthop resolution and
where it is legal because they are not expected to receive redirects
This is legal in your case of PtP link too, however, this is still nasty.
Alexey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-07-15 0:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-12 8:13 [PATCH] IPv6: Fix broken anycast usage Mika Liljeberg
2003-07-15 0:29 ` kuznet
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).