Subject: [Tools-discuss] rfcdiff lies

From: Carsten Bormann <[email-masked]>
Date: Mon, 21 Sep 2009 14:00:00 +0200

I just had an interesting encounter with rfcdiff, more precisely with

http://tools.ietf.org/rfcdiff?url2=draft-ietf-6lowpan-nd-05.txt

draft-ietf-6lowpan-nd-05.txt changes a packet format from its -04  
version:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Type      |     Code      |           Checksum            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              TID              |     Status    |P|   Reserved  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                           Lifetime                            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                  Owner Interface Identifier                   +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         Owner Nonce                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Registration option(s)...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+

           Figure 6: Node Registration/Confirmation message format

to its -05 version:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Type      |     Code      |           Checksum            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |      TID      |     Status    |P|          Reserved           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |        Binding Lifetime       |     Advertising Interval      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                  Owner Interface Identifier                   +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         Owner Nonce                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Registration option(s)...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+

           Figure 6: Node Registration/Confirmation message format

Note how the second word has changed, but this is expressed *only in  
whitespace*.

I can't exactly reproduce what rfcdiff makes out of this in this  
message.
See URL above.  But it suggests -05 says:

     0                   1                   2                   3
     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |     Type      |     Code      |           Checksum            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |              TID              |     Status    |P|   Reserved  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |        Binding Lifetime       |     Advertising Interval      |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                  Owner Interface Identifier                   +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                         Owner Nonce                           |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |   Registration option(s)...
    +-+-+-+-+-+-+-+-+-+-+-+-+-+

           Figure 6: Node Registration/Confirmation message format

I was just about to file the defect report on -05...

Whitespace *is* significant in RFC box notation!

Even if the change is not color-coded (which would probably be hard to  
do in general for whitespace-only changes), the right column should  
get its content from the actual file, not from the "unchanged"  
contents of the left column.
Until then, I'll triple-check my box notation from the original files.

Gruesse, Carsten

---

From: Henrik Levkowetz <[email-masked]>
Date: Mon, 21 Sep 2009 15:32:08 +0200

Hi Carsten,

> http://tools.ietf.org/rfcdiff?url2=draft-ietf-6lowpan-nd-05.txt

<snip details showing erroneous display of whitespace change>

Ugh.  Not good.

> contents of the left column.

Agreed.

> Until then, I'll triple-check my box notation from the original files.

I've made an experimental update of rfcdiff which doesn't consider white-
space significant when looking for changes in general.  Doing this only
for artwork requires a major re-write of the tool, so I'm looking for
workable solutions which require somewhat less work.

The URL above should now show the whitespace change faithfully, with
color-coding.  The drawback is that whitespace changes will be shown
throughout the file.  I don't really know if that is a problem with
today's draft-production tools, though.

Feedback on this would be appreciated.

Regards,

	Henrik

---

From: Carsten Bormann <[email-masked]>
Date: Mon, 21 Sep 2009 15:39:30 +0200

On Sep 21, 2009, at 15:32, Henrik Levkowetz wrote:

> space significant

Thanks!

As you can see from section 1.1, this adds a bit of noise, but also  
makes the result more comprehensible (pure whitespace changes were not  
echoed in the right column, so when an actual change intervenes, the  
indentation becomes strange).

I think it is correct to err on the side of not losing changes, so I  
applaud this modification.
That went fast, by the way!

Gruesse, Carsten

---

From: Henrik Levkowetz <[email-masked]>
Date: Mon, 21 Sep 2009 15:55:23 +0200

>> I've made an experimental update of rfcdiff which doesn't consider  

(s/significant/insignificant)

> indentation becomes strange).

Yes.  That was a known problem, but I didn't have a good solution to
it earlier.  The problem you pointed out made not ignoring whitespace
changes at all an option, which also fixes the wrong indentation.

> applaud this modification.

Ok, good.  If others don't come up with major reservations, I'll make
a regular release shortly.

> That went fast, by the way!

Thanks :-)

Best,

	Henrik