All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Arlott <simon@fire.lp0.eu>
To: "Templin, Fred L" <Fred.L.Templin@boeing.com>
Cc: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>,
	netdev@axxeo.de, netdev@vger.kernel.org
Subject: Re: [PATCH 02/05] ipv6: RFC4214 Support
Date: Wed, 07 Nov 2007 19:38:12 +0000	[thread overview]
Message-ID: <47321424.1050407@simon.arlott.org.uk> (raw)
In-Reply-To: <39C363776A4E8C4A94691D2BD9D1C9A1029EDBF9@XCH-NW-7V2.nw.nos.boeing.com>

On 07/11/07 19:32, Templin, Fred L wrote:
>  
> 
>> -----Original Message-----
>> From: Simon Arlott [mailto:simon@fire.lp0.eu] 
>> Sent: Wednesday, November 07, 2007 11:02 AM
>> To: Templin, Fred L
>> Cc: YOSHIFUJI Hideaki / 吉藤英明; netdev@axxeo.de; netdev@vger.kernel.org
>> Subject: Re: [PATCH 02/05] ipv6: RFC4214 Support
>> 
>> On 07/11/07 18:52, Templin, Fred L wrote:
>> >> > > > > +	eui[0] = 0;
>> >> > > > > +
>> >> > > > > +	/* Check for RFC3330 global address ranges */
>> >> > > > > +	if (((ipv4 >= 0x01000000) && (ipv4 < 0x0a000000)) ||
>> >> > > > > +	    ((ipv4 >= 0x0b000000) && (ipv4 < 0x7f000000)) ||
>> >> > > > > +	    ((ipv4 >= 0x80000000) && (ipv4 < 0xa9fe0000)) ||
>> >> > > > > +	    ((ipv4 >= 0xa9ff0000) && (ipv4 < 0xac100000)) ||
>> >> > > > > +	    ((ipv4 >= 0xac200000) && (ipv4 < 0xc0a80000)) ||
>> >> > > > > +	    ((ipv4 >= 0xc0a90000) && (ipv4 < 0xc6120000)) ||
>> >> > > > > +	    ((ipv4 >= 0xc6140000) && (ipv4 < 
>> >> 0xe0000000))) eui[0] |=
>> >> > > > > 0x2;
>> >> I don't understand.
>> >> 
>> >> For example, 1.0.0.11 is valid IPv4 global address.
>> >> In little-endian, this is not in the range of
>> >> 0x00000001 <= addr <= 0x0000000a (addr is 0x0b000001).
>> > 
>> > Maybe it is I who did not understand. Can you suggest a 
>> clean solution?
>> 
>> ((ipv4 & htonl(0xFF000000)) == htonl(0x0A000000)) etc.?
> 
> I'm not sure this works when we consider disjoint ranges
> of globally-unique IP prefixes. Do you have a vision for
> how the entire conditional would look like?

You need to match RFC3330 addresses, not anything that isn't.

((ipv4 & htonl(0xFF000000)) == htonl(0x0A000000))
|| ((ipv4 & htonl(0xFFFF0000)) == htonl(0xC0A80000))
|| ((ipv4 & htonl(0xFF000000)) == htonl(0x80000000))
etc.

-- 
Simon Arlott

  reply	other threads:[~2007-11-07 19:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-07  1:16 [PATCH 02/05] ipv6: RFC4214 Support Templin, Fred L
2007-11-07 15:58 ` Ingo Oeser
2007-11-07 16:12   ` Templin, Fred L
2007-11-07 18:12   ` YOSHIFUJI Hideaki / 吉藤英明
2007-11-07 18:24     ` Templin, Fred L
2007-11-07 18:48       ` YOSHIFUJI Hideaki / 吉藤英明
2007-11-07 18:52         ` Templin, Fred L
2007-11-07 19:01           ` Simon Arlott
2007-11-07 19:32             ` Templin, Fred L
2007-11-07 19:38               ` Simon Arlott [this message]
2007-11-07 19:47           ` YOSHIFUJI Hideaki / 吉藤英明
2007-11-09 18:12             ` Ingo Oeser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47321424.1050407@simon.arlott.org.uk \
    --to=simon@fire.lp0.eu \
    --cc=Fred.L.Templin@boeing.com \
    --cc=netdev@axxeo.de \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.