aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-07-24 01:32:34 -0700
committerGuy Harris <guy@alum.mit.edu>2016-07-24 08:33:08 +0000
commit2a3612f8e17c53ba71cf5fb9978a3a6e939f60d6 (patch)
treee75bd7604442cd3f6234e217717d304aaa3ffec0
parent284aed2c66c63185da6af1a6636fb526e047d9ed (diff)
Don't even *mention* the TTL/hop limit if we don't have it.
That's cleaner than reporting it as 0. Change-Id: I862130c98131ba83f9689201d852e2f1aab34770 Reviewed-on: https://code.wireshark.org/review/16619 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/dissectors/packet-icmp.c9
-rw-r--r--epan/dissectors/packet-icmpv6.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/epan/dissectors/packet-icmp.c b/epan/dissectors/packet-icmp.c
index 01afaa93fc..229c6d38e0 100644
--- a/epan/dissectors/packet-icmp.c
+++ b/epan/dissectors/packet-icmp.c
@@ -1297,10 +1297,15 @@ dissect_icmp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data)
proto_tree_add_item(icmp_tree, hf_icmp_seq_num_le, tvb, 6,
2, ENC_LITTLE_ENDIAN);
col_append_fstr(pinfo->cinfo, COL_INFO,
- " id=0x%04x, seq=%u/%u, ttl=%u",
+ " id=0x%04x, seq=%u/%u",
tvb_get_ntohs(tvb, 4), tvb_get_ntohs(tvb,
6),
- tvb_get_letohs(tvb, 6), (iph != NULL) ? iph->ip_ttl : 0);
+ tvb_get_letohs(tvb, 6));
+ if (iph != NULL) {
+ col_append_fstr(pinfo->cinfo, COL_INFO,
+ ", ttl=%u",
+ iph->ip_ttl);
+ }
break;
case ICMP_UNREACH:
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 3d830c7248..22a24c1870 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -3584,8 +3584,12 @@ dissect_icmpv6(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
sequence = tvb_get_ntohs(tvb, offset);
offset += 2;
- col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u, hop limit=%u",
- identifier, sequence, (iph != NULL) ? iph->ip_ttl : 0);
+ col_append_fstr(pinfo->cinfo, COL_INFO, " id=0x%04x, seq=%u",
+ identifier, sequence);
+ if (iph != NULL) {
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", hop limit=%u",
+ iph->ip_ttl);
+ }
if (pinfo->destport == 3544 && icmp6_type == ICMP6_ECHO_REQUEST) {
/* RFC 4380