Subject: [netmod] comparison of IP addresses

From: Ladislav Lhotka <[email-masked]>
Date: Tue, 27 Jul 2010 10:24:45 +0200

Hi,

following Juergen's comment in the meeting, I looked up what YANG spec
says about the canonical forms - it only requires the server to return
each value in the canonical form. Nothing seems to prevent or discourage
a module writer from using non-canonical constants in XPath expressions,
for example

must "ip-address = '0::1'";

This comparison won't work as expected.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Tue, 27 Jul 2010 10:47:12 +0200

> This comparison won't work as expected.

Yes, this leads to the same result as "ip-address = 'foobar'". If we
are lucky YANG compilers will get smart enough over time to detect
such things and that would be cool. But clearly, the bug is made by
the YANG module writer and at this time I do not think we need to add
extensions to YANG to make YANG module writers more efficient.

/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: Ladislav Lhotka <[email-masked]>
Date: Tue, 27 Jul 2010 11:32:43 +0200

> such things and that would be cool. But clearly, the bug is made by

A non-canonical value may also come from the client, e.g. as a list key.

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Tue, 27 Jul 2010 14:13:29 +0200

On Tue, Jul 27, 2010 at 11:32:43AM +0200, Ladislav Lhotka wrote:
> On ??t, 2010-07-27 at 10:47 +0200, Juergen Schoenwaelder wrote:

Yes, use of the canonical format is a good thing.

/js