aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-nsip.c
diff options
context:
space:
mode:
authorjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2008-09-08 06:02:35 +0000
committerjake <jake@f5534014-38df-0310-8fa8-9805f1628bb7>2008-09-08 06:02:35 +0000
commitf6bec08a96c4ada532a829b77e2bf8fbd385342b (patch)
treeae6a85a2b098b49be48c0b7e66fd0798343aa89e /epan/dissectors/packet-nsip.c
parent6ee908454fbdf69d62fdd9c0f1058504183461db (diff)
From Neil Piercy:
The IP Address IE did not decode correctly - the address fetch did not skip the Address Type field. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@26164 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-nsip.c')
-rw-r--r--epan/dissectors/packet-nsip.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/epan/dissectors/packet-nsip.c b/epan/dissectors/packet-nsip.c
index b142a5f333..2424a194d3 100644
--- a/epan/dissectors/packet-nsip.c
+++ b/epan/dissectors/packet-nsip.c
@@ -62,6 +62,7 @@ static int hf_nsip_max_num_ns_vc = -1;
static int hf_nsip_num_ip4_endpoints = -1;
static int hf_nsip_num_ip6_endpoints = -1;
static int hf_nsip_reset_flag = -1;
+static int hf_nsip_ip_address_type = -1;
static int hf_nsip_ip_address_ipv4 = -1;
static int hf_nsip_ip_address_ipv6 = -1;
static int hf_nsip_end_flag = -1;
@@ -212,6 +213,14 @@ static const value_string tab_nsip_cause_values[] = {
#define NSIP_IP_VERSION_4 4
#define NSIP_IP_VERSION_6 6
+static const value_string ip_address_type_vals[] = {
+ { 0, "Reserved" },
+ { NSIP_IP_ADDRESS_TYPE_IPV4, "IPv4 Address" },
+ { NSIP_IP_ADDRESS_TYPE_IPV6, "IPv6 Address" },
+ { 0, NULL },
+};
+
+
#define NSIP_MASK_CONTROL_BITS_R 0x01
#define NSIP_MASK_CONTROL_BITS_C 0x02
#define NSIP_MASK_END_FLAG 0x01
@@ -520,10 +529,12 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
struct e_in6_addr ip6_addr;
address_type = tvb_get_guint8(bi->tvb, bi->offset);
+ proto_tree_add_item(bi->nsip_tree, hf_nsip_ip_address_type,
+ bi->tvb, bi->offset, 1, FALSE);
switch (address_type) {
case NSIP_IP_ADDRESS_TYPE_IPV4:
ie->total_length = 2 + ipv4_element.address_length;
- ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset);
+ ip4_addr = tvb_get_ipv4(bi->tvb, bi->offset+1);
if (bi->nsip_tree) {
proto_tree_add_ipv4(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
@@ -532,7 +543,7 @@ decode_iei_ip_address(nsip_ie_t *ie, build_info_t *bi, int ie_start_offset) {
break;
case NSIP_IP_ADDRESS_TYPE_IPV6:
ie->total_length = 2 + ipv6_element.address_length;
- tvb_get_ipv6(bi->tvb, bi->offset, &ip6_addr);
+ tvb_get_ipv6(bi->tvb, bi->offset+1, &ip6_addr);
if (bi->nsip_tree) {
proto_tree_add_ipv6(bi->nsip_tree, hf_nsip_ip_address_ipv4,
bi->tvb, ie_start_offset, ie->total_length,
@@ -1021,6 +1032,11 @@ proto_register_nsip(void)
FT_BOOLEAN, 8, TFS(&set_unset), NSIP_MASK_RESET_FLAG,
"", HFILL }
},
+ { &hf_nsip_ip_address_type,
+ { "IP Address Type", "nsip.ip_address_type",
+ FT_UINT8, BASE_DEC, VALS(ip_address_type_vals), 0x0,
+ "", HFILL }
+ },
{ &hf_nsip_ip_address_ipv4,
{ "IP Address", "nsip.ip_address",
FT_IPv4, BASE_NONE, NULL, 0x0,