http: Fix src/dest mapping for proxied connections
authorPeter Wu <peter@lekensteyn.nl>
Sun, 27 Apr 2014 08:39:23 +0000 (10:39 +0200)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Sun, 27 Apr 2014 18:08:44 +0000 (18:08 +0000)
commit5600ae100a7631a271286794a9ce0984525c3fe9
tree9ecae1bdc191b937a31e8046c5ac8ad16be02c3a
parent338269fe41d6617a089a81d7e2ed0aa4e71819d7
http: Fix src/dest mapping for proxied connections

Using value_is_in_range is making quite some assumptions, namely (1) the
proxy server is always run on a registered HTTP port, and (2) the
source (client) port is always not HTTP. The former is quite a strong
assertion which fails to hold when using a custom port (8008) that got
detected through heuristics.

Fix this by recording the source address and port pair for the server
and then check this against the current packet.

This fixes detection of a SSL conversation where two conversations got
detected instead of one. Example: 8008 is proxy, 443 is target server.
Now the proxied conversation got detected as 443 --> "client port"
(server to client, ok) and 443 --> 8008 (client to server, not ok,
should be "client port" --> 443).

bug:7717
Change-Id: I05113ec2aca6c9296184759a8a62eb32cbfcbb4f
Reviewed-on: https://code.wireshark.org/review/1380
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
epan/dissectors/packet-http.c
epan/dissectors/packet-http.h