diff options
author | Pascal Quantin <pascal@wireshark.org> | 2022-12-12 14:16:34 +0100 |
---|---|---|
committer | Pascal Quantin <pascal@wireshark.org> | 2022-12-12 20:43:04 +0000 |
commit | 73866d36239d240fc67ce41e2f981935d4413a38 (patch) | |
tree | 7e112d5b94d13cabc7a69c4d7408ebb1cb8c40cf /epan | |
parent | 7d20bd0b101ca646e39d566386f87550d5f21612 (diff) |
RoHC: fix dissection of IP version alternate encoding for IP profile
As specified in RFC 3843 chapter 3.1
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-rohc.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c index b314fa5b21..2ea5c66a93 100644 --- a/epan/dissectors/packet-rohc.c +++ b/epan/dissectors/packet-rohc.c @@ -69,6 +69,7 @@ static int hf_rohc_opt_loss = -1; static int hf_rohc_profile = -1; static int hf_rohc_d_bit = -1; static int hf_rohc_ip_version = -1; +static int hf_rohc_ip_version_ip_profile = -1; static int hf_rohc_ip_protocol = -1; static int hf_rohc_static_ipv4 = -1; static int hf_rohc_ipv4_src = -1; @@ -302,6 +303,15 @@ static const value_string rohc_ip_version_vals[] = { 0, NULL }, }; +static const value_string rohc_ip_version_ip_profile_vals[] = +{ + { 0x4, "IPv4" }, + { 0x6, "IPv6" }, + { 0xc, "IPv4" }, + { 0xe, "IPv6" }, + { 0, NULL }, +}; + static const value_string rohc_var_len_vals[] = { { 0, "One octet" }, @@ -2188,7 +2198,13 @@ dissect_rohc_ir_rtp_udp_ip_profile_static(tvbuff_t *tvb, proto_tree *tree, packe /* for all profiles except uncompressed */ if (profile != ROHC_PROFILE_UNCOMPRESSED) { version = tvb_get_guint8(tvb,offset)>>4; - ver_item = proto_tree_add_item(sub_tree, hf_rohc_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN); + if (profile == ROHC_PROFILE_IP) { + /* RFC 3843 chapter 3.1; alternate encoding can set IP version field MSB to 1 */ + version &= 0x07; + ver_item = proto_tree_add_item(sub_tree, hf_rohc_ip_version_ip_profile, tvb, offset, 1, ENC_BIG_ENDIAN); + } else { + ver_item = proto_tree_add_item(sub_tree, hf_rohc_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN); + } rohc_cid_context->rohc_ip_version = version; switch (version) { @@ -3153,6 +3169,12 @@ proto_register_rohc(void) NULL , HFILL } }, + { &hf_rohc_ip_version_ip_profile, + { "Version","rohc.ip.version", + FT_UINT8, BASE_DEC, VALS(rohc_ip_version_ip_profile_vals), 0xf0, + NULL , HFILL + } + }, { &hf_rohc_static_ipv4, { "Static IPv4 chain", "rohc.static.ipv4", FT_NONE, BASE_NONE, NULL, 0x0, |