summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-icmpv6.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-17 15:00:52 +0000
commit0f157e7d6c4be48f213ea022cb2d6d1316c423c8 (patch)
treeff4ad271b50a39e23d5a50a54f4bff37342cdc1c /epan/dissectors/packet-icmpv6.c
parentAdding debian version 4.2.4-1. (diff)
downloadwireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.tar.xz
wireshark-0f157e7d6c4be48f213ea022cb2d6d1316c423c8.zip
Merging upstream version 4.2.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'epan/dissectors/packet-icmpv6.c')
-rw-r--r--epan/dissectors/packet-icmpv6.c51
1 files changed, 38 insertions, 13 deletions
diff --git a/epan/dissectors/packet-icmpv6.c b/epan/dissectors/packet-icmpv6.c
index 08b29344..4a085f5f 100644
--- a/epan/dissectors/packet-icmpv6.c
+++ b/epan/dissectors/packet-icmpv6.c
@@ -1349,20 +1349,22 @@ static const value_string mpl_seed_id_lengths[] = {
};
static const guint8 mpl_seed_id_code_to_length[] = { 0, 2, 8, 16 }; /* bytes */
+#define LIFETIME_INFINITY 0xFFFFFFFF
+
static const value_string unique_infinity[] = {
- { 0xffffffff, "Infinity" },
+ { LIFETIME_INFINITY, "Infinity" },
{ 0, NULL}
};
static const value_string dnssl_infinity[] = {
{ 0, "DNSSL domain name MUST no longer be used" },
- { 0xffffffff, "Infinity" },
+ { LIFETIME_INFINITY, "Infinity" },
{ 0, NULL}
};
static const value_string rdnss_infinity[] = {
{ 0, "RDNSS address MUST no longer be used" },
- { 0xffffffff, "Infinity" },
+ { LIFETIME_INFINITY, "Infinity" },
{ 0, NULL}
};
@@ -1820,12 +1822,16 @@ static int dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Prefix Valid Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_valid_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
/* Prefix Preferred Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_prefix_preferred_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
proto_tree_add_item(icmp6opt_tree, hf_icmpv6_opt_reserved, tvb, opt_offset, 4, ENC_NA);
@@ -2228,7 +2234,9 @@ static int dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* Route Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
/* Prefix */
@@ -2267,7 +2275,9 @@ static int dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* RDNSS Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_rdnss_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
while(opt_offset < (offset + opt_len) ) {
@@ -2415,7 +2425,9 @@ static int dissect_icmpv6_nd_opt(tvbuff_t *tvb, int offset, packet_info *pinfo,
/* DNSSL Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_opt_dnssl_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
while(opt_offset < (offset + opt_len) ) {
@@ -2903,6 +2915,8 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
guint8 prefix_len;
ws_in6_addr prefix;
address prefix_addr;
+ uint32_t lifetime;
+
static int * const rpl_flags[] = {
&hf_icmpv6_rpl_opt_route_pref,
&hf_icmpv6_rpl_opt_route_reserved,
@@ -2920,7 +2934,10 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
opt_offset +=1;
/* Prefix lifetime. */
- proto_tree_add_item(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN);
+ ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_route_lifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
switch(opt_len){
@@ -3128,12 +3145,16 @@ dissect_icmpv6_rpl_opt(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
/* Valid Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_vlifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
/* Preferred Lifetime */
ti_opt = proto_tree_add_item_ret_uint(icmp6opt_tree, hf_icmpv6_rpl_opt_prefix_plifetime, tvb, opt_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti_opt, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
opt_offset += 4;
/* 4 reserved bytes. */
@@ -3852,12 +3873,16 @@ dissect_rrenum(tvbuff_t *tvb, int rr_offset, packet_info *pinfo _U_, proto_tree
/* Valid Lifetime */
ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_validlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
rr_offset += 4;
/* Preferred Lifetime */
ti = proto_tree_add_item_ret_uint(up_tree, hf_icmpv6_rr_pco_up_preferredlifetime, tvb, rr_offset, 4, ENC_BIG_ENDIAN, &lifetime);
- proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ if (lifetime != LIFETIME_INFINITY) {
+ proto_item_append_text(ti, " (%s)", unsigned_time_secs_to_str(wmem_packet_scope(), lifetime));
+ }
rr_offset += 4;
/* Flags */