Ethereal-dev: Re: Re(2): [Ethereal-dev] Support for payload protocol identifier

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Sat, 13 Jan 2001 10:25:44 -0800
On Sat, Jan 13, 2001 at 02:59:59PM +0100, Michael Tüxen wrote:
> The problem with your solution is, that dissector_try_port sets the
> pinfo->match_port to the parameter port, which would be the
> payload_proto_id and NOT the source or destination port.

"port", for better or worse, doesn't mean "{TCP,UDP} port" in that part
of Ethereal; for example, it refers to an Ethernet protocol type in
routines called from a table whose keys are Ethernet protocol types.

As such, it has always been an error for dissectors that register
themselves in such a table with values other than TCP or UDP ports to
assume that "pinfo->match_port" is always a TCP or UDP port number.

Perhaps a different name should be chosen, rather than "port"; however,
I think it's overkill to have two functions with almost identical
behavior except for whether they save "pinfo->match_port".

> So I deleted this line of code and the name of the
> modified function
> was dissector_try_payload_proto_id. It is only to avoid the possible
> misinterpretation of pinfo->match_port in call subdissectors.

No dissectors that look at "match_port" currently register themselves
with anything other than a TCP or UDP port number, so no dissector yet
misinterprets it in that fashion.