Wireshark-bugs: [Wireshark-bugs] [Bug 6787] Move Y.1711 out of MPLS dissector

Date: Tue, 31 Jul 2012 15:36:09 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6787

--- Comment #22 from Bill Meier <wmeier@xxxxxxxxxxx> 2012-07-31 15:36:08 PDT ---
(In reply to comment #21)
> So, I suspect the above pseudo-code be written more like this:
> 
>     while(tvb_reported_length_remaining(tvb, offset) > 0) {
>         ...
>         if(...)
>             break;
>     }
> 

Right you are ...

(In fact, your version is actually what is in packet-mpls.c. I was in much too
much of a hurry when I wrote the comment   :) ).

> Sadly, when I ran a quick search not too long ago, I counted 1599 occurrences
> of tvb_length_remaining() vs. only 1022 occurrences of
> tvb_reported_length_remaining().  I'm willing to bet that:
> 
> 1) In many case, there's no need to use either of them at all.
> 2) Of the valid cases for using them that remain, many of the
> tvb_length_remaining()'s should probably be converted to
> tvb_reported_length_remaining().
> 
> Figuring out which are needed and which are not, as well as which should be
> converted, doesn't sound like a particularly fun task though.

Agreed: I've been changing things to ...reported_length... at times, but it's a
thankless task.

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.