[PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

STALE6961d

11 messages, 6 authors, 2007-07-31 · open the first message on its own page

[PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Dave Johnson <hidden>
Date: 2007-07-26 00:19:17

ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.

SCTP uses this function and will fail bind() and connect() calls that
use RFC4193 addresses, SCTP will also ignore inbound connections from
RFC4193 addresses if listening on IPV6_ADDR_ANY.

There may be other users of ipv6_addr_type() that could also have
problems.

Signed-off-by: Dave Johnson <redacted>
Cc: Srinivas Akkipeddi <redacted>

===== net/ipv6/addrconf_core.c 1.2 vs edited =====
--- 1.2/net/ipv6/addrconf_core.c	2007-02-26 14:42:57 -05:00
+++ edited/net/ipv6/addrconf_core.c	2007-07-25 15:21:41 -04:00
@@ -50,6 +50,9 @@
 	if ((st & htonl(0xFFC00000)) == htonl(0xFEC00000))
 		return (IPV6_ADDR_SITELOCAL | IPV6_ADDR_UNICAST |
 			IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_SITELOCAL));		/* addr-select 3.1 */
+	if ((st & htonl(0xFE000000)) == htonl(0xFC000000))
+		return (IPV6_ADDR_UNICAST |
+			IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_GLOBAL));			/* RFC 4193 */
 
 	if ((addr->s6_addr32[0] | addr->s6_addr32[1]) == 0) {
 		if (addr->s6_addr32[2] == 0) {

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: David Miller <davem@davemloft.net>
Date: 2007-07-26 00:12:19

From: Dave Johnson <redacted>
Date: Wed, 25 Jul 2007 19:49:09 -0400
ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.

SCTP uses this function and will fail bind() and connect() calls that
use RFC4193 addresses, SCTP will also ignore inbound connections from
RFC4193 addresses if listening on IPV6_ADDR_ANY.

There may be other users of ipv6_addr_type() that could also have
problems.
Contrarily, there may be ipv6_addr_type() call sites that really
do want to reject rfc4193 addresses.

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Dave Johnson <hidden>
Date: 2007-07-26 01:12:01

David Miller writes:
Contrarily, there may be ipv6_addr_type() call sites that really
do want to reject rfc4193 addresses.
A quick look through the callers and only these functions should be
effected, they check either RESERVED or UNICAST from ipv6_addr_type():

net/ipv6/addrconf.c:                ipv6_dev_get_saddr()
net/ipv6/exthdrs.c:                 ipv6_dest_hao()   
net/ipv6/ip6_tunnel.c:              ip6_tnl_set_cap()
net/ipv6/netfilter/ip6t_REJECT.c:   send_reset()
net/ipv6/route.c:                   ip6_route_add()
net/ipv6/route.c:                   ip6_pkt_drop()
net/sctp/ipv6.c:                    sctp_v6_available()
net/sctp/ipv6.c:                    sctp_v6_addr_valid()

-- 
Dave Johnson
Starent Networks

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Simon Arlott <hidden>
Date: 2007-07-26 17:22:18

On 26/07/07 00:49, Dave Johnson wrote:
ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.
+	if ((st & htonl(0xFE000000)) == htonl(0xFC000000))
+		return (IPV6_ADDR_UNICAST |
+			IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_GLOBAL));			/* RFC 4193 */
But ULA's scope isn't global, shouldn't it be IPV6_ADDR_SCOPE_ORGLOCAL ?

-- 
Simon Arlott

Re: [Lksctp-developers] [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Vlad Yasevich <hidden>
Date: 2007-07-26 18:00:10

Dave Johnson wrote:
David Miller writes:
quoted
Contrarily, there may be ipv6_addr_type() call sites that really
do want to reject rfc4193 addresses.
A quick look through the callers and only these functions should be
effected, they check either RESERVED or UNICAST from ipv6_addr_type():

net/ipv6/addrconf.c:                ipv6_dev_get_saddr()
net/ipv6/exthdrs.c:                 ipv6_dest_hao()   
net/ipv6/ip6_tunnel.c:              ip6_tnl_set_cap()
net/ipv6/netfilter/ip6t_REJECT.c:   send_reset()
net/ipv6/route.c:                   ip6_route_add()
net/ipv6/route.c:                   ip6_pkt_drop()
net/sctp/ipv6.c:                    sctp_v6_available()
net/sctp/ipv6.c:                    sctp_v6_addr_valid()
Well, it's not just for SCTP.  ULA address are considered of Global scope.
See this message
	http://marc.info/?l=linux-netdev&m=118492205915816&w=2

-vlad

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Dave Johnson <hidden>
Date: 2007-07-26 18:01:27

Simon Arlott writes:
But ULA's scope isn't global, shouldn't it be IPV6_ADDR_SCOPE_ORGLOCAL ?
Isn't ORGLOCAL defined for multicast only?

rfc4193 section 3.3 says:
3.3. Scope Definition
   By default, the scope of these addresses is global.  That is, they
   are not limited by ambiguity like the site-local addresses defined in
   [ADDARCH]. 

-- 
Dave Johnson
Starent Networks

Re: [Lksctp-developers] [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Vlad Yasevich <hidden>
Date: 2007-07-26 18:22:36

Dave Johnson wrote:
Simon Arlott writes:
quoted
But ULA's scope isn't global, shouldn't it be IPV6_ADDR_SCOPE_ORGLOCAL ?
Isn't ORGLOCAL defined for multicast only?
Yes, it's only for multicast.  Unicast addresses only have
2 scopes any more: Global and Link-Local.

-vlad
rfc4193 section 3.3 says:
quoted
3.3. Scope Definition
   By default, the scope of these addresses is global.  That is, they
   are not limited by ambiguity like the site-local addresses defined in
   [ADDARCH]. 

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2007-07-26 18:34:19

Hello.

In article [off-list ref] (at Wed, 25 Jul 2007 19:49:09 -0400), Dave Johnson [off-list ref] says:
ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.
Acked-by: YOSHIFUJI Hideaki <redacted>

I would say, it would be better to add IPV6_ADDR_UNICAST as well
for "reserved" addresses unless we have good reason not to do it,
anyway.

-- 
YOSHIFUJI Hideaki @ USAGI Project  [off-list ref]
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: YOSHIFUJI Hideaki / 吉藤英明 <hidden>
Date: 2007-07-26 18:36:33

In article [off-list ref] (at Wed, 25 Jul 2007 17:12:03 -0700 (PDT)), David Miller [off-list ref] says:
Contrarily, there may be ipv6_addr_type() call sites that really
do want to reject rfc4193 addresses.
I do not think we have such users.

--yoshfuji

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: Rémi Denis-Courmont <hidden>
Date: 2007-07-26 18:42:43

On Thursday 26 July 2007 20:21:59 Simon Arlott wrote:
On 26/07/07 00:49, Dave Johnson wrote:
quoted
ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.

+	if ((st & htonl(0xFE000000)) == htonl(0xFC000000))
+		return (IPV6_ADDR_UNICAST |
+			IPV6_ADDR_SCOPE_TYPE(IPV6_ADDR_SCOPE_GLOBAL));			/* RFC 4193 */
But ULA's scope isn't global, shouldn't it be IPV6_ADDR_SCOPE_ORGLOCAL ?
Yes it is - global.

-- 
Rémi Denis-Courmont

Re: [PATCH] IPv6: ipv6_addr_type() doesn't know about RFC4193 addresses

From: David Miller <davem@davemloft.net>
Date: 2007-07-31 00:21:23

From: YOSHIFUJI Hideaki / 吉藤英明 <redacted>
Date: Thu, 26 Jul 2007 13:34:52 -0500 (CDT)
In article [off-list ref] (at Wed, 25 Jul 2007 19:49:09 -0400), Dave Johnson [off-list ref] says:
quoted
ipv6_addr_type() doesn't check for 'Unique Local IPv6 Unicast
Addresses' (RFC4193) and returns IPV6_ADDR_RESERVED for that range.
Acked-by: YOSHIFUJI Hideaki <redacted>
Ok, I've applied Dave's patch.

Dave, although it's customary and fine to use "+foo-list" email
addresses for mailing list subscriptions and discussions, I
ask that you don't add that cookie to your signoff lines in
patch submissions and I've removed it from your's in this patch.

Thanks a lot.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help