aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2020-01-04 17:31:11 +0000
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2020-01-05 09:11:11 +0000
commit376d8770121ab848ee4b679f2aa18bea13e42742 (patch)
treeb4ff294f582d5e316bf969a4bf4c93230cb7105b
parentb401c926154f4da6ea051ad83a7211236638b68b (diff)
IPv4: Fix incorrect expert info for IGMP TTL
IGMP uses TTL = 1 for the network control block. The code assumes a certain registered multicast destination address always carries traffic for that protocol, which isn't true. For example mDNS usually uses a TTL of 255 but IGMP Membership reports use a TTL of 1 for the same destination address. The end result is that IGMP traffic to mDNS multicast destination shows a confusing and incorrect "TTL != 255 for the Local Network Control Block" expert info. Rename the "ttl" variable for clarity. Change-Id: I693306cd6531aa250a6f5884a6731a2ea254bf2a Reviewed-on: https://code.wireshark.org/review/35639 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
-rw-r--r--epan/dissectors/packet-ip.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ip.c b/epan/dissectors/packet-ip.c
index bd8f0685f0..cac6f01b40 100644
--- a/epan/dissectors/packet-ip.c
+++ b/epan/dissectors/packet-ip.c
@@ -1863,7 +1863,7 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
guint32 src32, dst32;
proto_tree *tree;
proto_item *item = NULL, *ttl_item;
- guint16 ttl;
+ guint16 ttl_valid;
static const int * ip_flags[] = {
&hf_ip_flags_rf,
@@ -2147,11 +2147,14 @@ dissect_ip_v4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void*
* (see http://tools.ietf.org/html/rfc3973#section-4.7).
*/
if (in4_addr_is_local_network_control_block(dst32)) {
- ttl = local_network_control_block_addr_valid_ttl(dst32);
- if (ttl != iph->ip_ttl && ttl != IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL) {
+ if (iph->ip_proto == IP_PROTO_IGMP)
+ ttl_valid = IPLOCAL_NETWRK_CTRL_BLK_DEFAULT_TTL;
+ else
+ ttl_valid = local_network_control_block_addr_valid_ttl(dst32);
+ if (iph->ip_ttl != ttl_valid && ttl_valid != IPLOCAL_NETWRK_CTRL_BLK_ANY_TTL) {
expert_add_info_format(pinfo, ttl_item, &ei_ip_ttl_lncb, "\"Time To Live\" != %d for a packet sent to the "
"Local Network Control Block (see RFC 3171)",
- ttl);
+ ttl_valid);
}
} else if (iph->ip_ttl < 5 && !in4_addr_is_multicast(dst32) &&
/* At least BGP should appear here as well */