aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2018-04-11 22:07:41 +0200
committerPascal Quantin <pascal.quantin@gmail.com>2018-04-12 14:55:23 +0000
commit49470c15af609f58deae1bd9511dac3231d4bf1e (patch)
treea1f6473f8c82f7711b123042715ed1f27047fe36
parent1e82b9035c1396ca641d17e45db8927ee54e2e4e (diff)
RoHC: IP version is 1 byte only
Change-Id: I533b9d3ef37af9aa13a20c9af82a8a75cd73e9ad Reviewed-on: https://code.wireshark.org/review/26895 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
-rw-r--r--epan/dissectors/packet-pdcp-lte.c4
-rw-r--r--epan/dissectors/packet-rohc.c4
-rw-r--r--epan/dissectors/packet-rohc.h4
3 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-pdcp-lte.c b/epan/dissectors/packet-pdcp-lte.c
index 47a05fb..385e5d1 100644
--- a/epan/dissectors/packet-pdcp-lte.c
+++ b/epan/dissectors/packet-pdcp-lte.c
@@ -1362,7 +1362,9 @@ static gboolean dissect_pdcp_lte_heur(tvbuff_t *tvb, packet_info *pinfo,
offset++;
break;
case PDCP_LTE_ROHC_IP_VERSION_TAG:
- p_pdcp_lte_info->rohc.rohc_ip_version = tvb_get_ntohs(tvb, offset);
+ /* RoHC IP version field is now 1 byte only; let's skip most significant byte
+ to keep backward compatibility with existing UDP framing protocol */
+ p_pdcp_lte_info->rohc.rohc_ip_version = tvb_get_guint8(tvb, offset+1);
offset += 2;
break;
case PDCP_LTE_ROHC_CID_INC_INFO_TAG:
diff --git a/epan/dissectors/packet-rohc.c b/epan/dissectors/packet-rohc.c
index 3efe71d..f62bfe9 100644
--- a/epan/dissectors/packet-rohc.c
+++ b/epan/dissectors/packet-rohc.c
@@ -211,7 +211,7 @@ static dissector_handle_t ipv6_handle;
typedef struct _rohc_cid_context_t
{
- guint16 rohc_ip_version;
+ guint8 rohc_ip_version;
gboolean large_cid_present;
enum rohc_mode mode;
enum rohc_d_mode d_mode;
@@ -3083,7 +3083,7 @@ proto_register_rohc(void)
{ &hf_rohc_ir_ip_version,
{ "Mode","rohc.ir_ip_version",
- FT_UINT16, BASE_DEC, VALS(rohc_ip_version_vals), 0x0,
+ FT_UINT8, BASE_DEC, VALS(rohc_ip_version_vals), 0x0,
NULL , HFILL
}
},
diff --git a/epan/dissectors/packet-rohc.h b/epan/dissectors/packet-rohc.h
index 7ae035c..30865da 100644
--- a/epan/dissectors/packet-rohc.h
+++ b/epan/dissectors/packet-rohc.h
@@ -37,7 +37,7 @@ enum rohc_d_mode
typedef struct rohc_info
{
gboolean rohc_compression;
- guint16 rohc_ip_version;
+ guint8 rohc_ip_version;
gboolean cid_inclusion_info;
gboolean large_cid_present;
enum rohc_mode mode;
@@ -50,7 +50,7 @@ typedef struct rohc_info
typedef struct rohc_context
{
- guint16 rohc_ip_version[MAX_CID+1];
+ guint8 rohc_ip_version[MAX_CID+1];
gboolean large_cid_present[MAX_CID+1];
enum rohc_mode mode[MAX_CID+1];
enum rohc_d_mode d_mode[MAX_CID+1];