Subject: Re: [netmod] ipv6 address normalization ??

From: Juergen Schoenwaelder <[email-masked]>
Date: Thu, 5 Feb 2009 22:19:04 +0100

On Tue, Dec 23, 2008 at 08:12:04PM +0100, Simon Leinen wrote:
 
> I would also add that the :: subsitution should only be applied to
> sequences of two or more all-zero chunks, i.e. you shouldn't compress
> 
>   2000:0:2:3:4:5:6:7 => 2000::2:3:4:5:6:7
> 
> This is a matter of taste and convention.  The existing inet_ntop()
> code that I checked doesn't compress a single zero.

It seems the inet_ntop() code Paul Vixie wrote and which is part of
glibc (and I think also some BSD libcs) does compress a single
all-zero chunk. I would prefer to keep it this way. I am wondering
which code you checked...

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1, 28759 Bremen, Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 05 Feb 2009 22:21:29 +0100 (CET)

Simon Leinen <[email-masked]> wrote:
> Juergen Schoenwaelder writes:
> >     * Allow multiple formats and representations
> >     * Make the shortened format the canonical format
> >     * The :: substitution must be applied to the longest sequence of
> >       zeros in an IPv6 address (if there is a tie, the first sequence
> >       of zeros is replaced by ::)
> 
> "Sequence of zeros"... I would prefer "sequence of all-zero 16-bit
> chunks", as that is clearer (if more verbose).

I support Juergen's proposal with this clarification.

> sequences of two or more all-zero chunks, i.e. you shouldn't compress

I agree with this - we should do what the standard functions do.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 05 Feb 2009 22:32:04 +0100 (CET)

> which code you checked...

I tried this with glibc 2.8.90, and it did not compress a single
zero.

/martin

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Thu, 5 Feb 2009 23:13:31 +0100

> I tried this with glibc 2.8.90, and it did not compress a single

Hm. Wrong window. I stand corrected. The Paul Vixie code does indeed
not compress single all-zero chunks. The relevant line in his source
code is this:

    if (best.base != -1 && best.len < 2)
        best.base = -1;

But MacOS X does seem to always compress. Can someone check on Win32?

/js

---

From: Per Hedeland <[email-masked]>
Date: Thu, 05 Feb 2009 23:25:40 +0100

> But MacOS X does seem to always compress. Can someone check on Win32?

Sorry, not me, but here are a few other data points:

FreeBSD 6.0
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

FreeBSD 7.0
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

Linux glibc 2.4
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

Linux glibc 2.7
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

NetBSD 3.1
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

NetBSD 4.0
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

SunOS 5.10
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

QNX 6.3.2
2000:0:2:3:4:5:6:7 -> 2000:0:2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

Darwin 9.6.0
2000:0:2:3:4:5:6:7 -> 2000::2:3:4:5:6:7
2000:0:0:3:4:5:6:7 -> 2000::3:4:5:6:7

--Per Hedeland

---

From: WashamFan <[email-masked]>
Date: Fri, 06 Feb 2009 10:04:42 +0800

Hi,

definition:
list interface {
         key "name";
         leaf name {
             type string;
         }
         leaf ifIndex {
             type uint32;
         }
         list address {
             key "ip";
             leaf ip {
                 type yang:ip-address;
             }
         }
     }
but the corresponding XML snippet:
<interface>
       <name>eth0</name>
       <address>
         <ip>192.0.2.1</ip>
       </address>
       <address>
         <ip>192.0.2.2</ip>
       </address>
     </interface>
     <interface>
       <name>lo</name>
       <address>
         <ip>127.0.0.1</ip>
       </address>
     </interface>
where is <ifIndex>, this node is referenced by following notification.

washam

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 06 Feb 2009 11:02:56 +0100 (CET)

WashamFan <[email-masked]> wrote:
> where is <ifIndex>

Bug, now fixed.

/martin