aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipsec.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-07-24 19:11:01 +0100
committerJoão Valverde <j@v6e.pt>2016-07-25 10:04:49 +0000
commit77915051685fee048571031769bbed05531fd852 (patch)
tree1c9bad7b813fc84ccdb142177b5e6a331581aa4e /epan/dissectors/packet-ipsec.c
parent6cf9616df68a4db7e436bb77392586ff9ad84feb (diff)
IPv6: Use ipv6_pinfo_t instead of ws_ip to keep some state
To perform IPv6 defragmentation we need to compute the IPv6 fragment header payload length by subtracting the length of intermediate extension headers from the IPv6 payload length. Add a new frag_plen field to ipv6_pinfo_t to do that instead of (ab)using struct ws_ip. Note: The RFC 2460 rules for fragment header order are stricter than the code suggests but that shouldn't be a problem here. Change-Id: I76f3cb3a1a29d96b080d3d53c0f493f9d0b2786c Reviewed-on: https://code.wireshark.org/review/16637 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/dissectors/packet-ipsec.c')
-rw-r--r--epan/dissectors/packet-ipsec.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/epan/dissectors/packet-ipsec.c b/epan/dissectors/packet-ipsec.c
index 7998af1a03..853ad5251a 100644
--- a/epan/dissectors/packet-ipsec.c
+++ b/epan/dissectors/packet-ipsec.c
@@ -1099,7 +1099,6 @@ dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
tvbuff_t *next_tvb;
dissector_handle_t dissector_handle;
guint32 saved_match_uint;
- ws_ip *iph = (ws_ip *)data;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AH");
col_clear(pinfo->cinfo, COL_INFO);
@@ -1113,6 +1112,7 @@ dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
if (pinfo->dst.type == AT_IPv6) {
ipv6_pinfo_t *ipv6_pinfo = p_get_ipv6_pinfo(pinfo);
+ ipv6_pinfo->frag_plen -= ah_hdr_len;
if (ipv6_pinfo->ipv6_tree != NULL) {
root_tree = ipv6_pinfo->ipv6_tree;
ipv6_pinfo->ipv6_item_len += ah_hdr_len;
@@ -1137,13 +1137,8 @@ dissect_ah(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
next_tvb = tvb_new_subset_remaining(tvb, ah_hdr_len);
- if (iph != NULL) {
- iph->ip_nxt = ah_nxt;
- iph->ip_len -= ah_hdr_len;
- }
-
if (pinfo->dst.type == AT_IPv6) {
- ipv6_dissect_next(ah_nxt, next_tvb, pinfo, tree, iph);
+ ipv6_dissect_next(ah_nxt, next_tvb, pinfo, tree, (ws_ip *)data);
} else {
/* do lookup with the subdissector table */
saved_match_uint = pinfo->match_uint;