aboutsummaryrefslogtreecommitdiffstats
path: root/packet-ipv6.c
diff options
context:
space:
mode:
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-21 04:15:14 +0000
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>2000-03-21 04:15:14 +0000
commita5c3282ff58dbece3306093818d78399b29a57d5 (patch)
treed8a5e1b262dc1fe163bff9afd94318ae8eab7438 /packet-ipv6.c
parentfde3ddd0e6a8ae3edb0d8778f247ff17941207bf (diff)
Jochen Friedrich's fix to IPv6 fragment handling.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1734 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'packet-ipv6.c')
-rw-r--r--packet-ipv6.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/packet-ipv6.c b/packet-ipv6.c
index 9d7a1882bb..b93f3cc2bc 100644
--- a/packet-ipv6.c
+++ b/packet-ipv6.c
@@ -1,7 +1,7 @@
/* packet-ipv6.c
* Routines for IPv6 packet disassembly
*
- * $Id: packet-ipv6.c,v 1.30 2000/03/14 06:03:22 guy Exp $
+ * $Id: packet-ipv6.c,v 1.31 2000/03/21 04:15:04 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -137,18 +137,19 @@ dissect_routing6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree)
}
static int
-dissect_frag6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
+dissect_frag6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree,
+ int *fragstart) {
struct ip6_frag frag;
int len;
memcpy(&frag, (void *) &pd[offset], sizeof(frag));
len = sizeof(frag);
-
+ *fragstart = ntohs(frag.ip6f_offlg) & 0xfff8;
if (check_col(fd, COL_INFO)) {
col_add_fstr(fd, COL_INFO,
"IPv6 fragment (nxt=%s (0x%02x) off=0x%04x id=0x%x)",
ipprotostr(frag.ip6f_nxt), frag.ip6f_nxt,
- (frag.ip6f_offlg >> 3) & 0x1fff, frag.ip6f_ident);
+ *fragstart, frag.ip6f_ident);
}
return len;
}
@@ -254,6 +255,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
guint8 nxt;
int advance;
int poffset;
+ int frag;
struct ip6_hdr ipv6;
@@ -332,6 +334,7 @@ dissect_ipv6(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
/* start of the new header (could be a extension header) */
nxt = pd[poffset = offset + offsetof(struct ip6_hdr, ip6_nxt)];
offset += sizeof(struct ip6_hdr);
+ frag = 0;
again:
switch (nxt) {
@@ -349,7 +352,7 @@ again:
offset += advance;
goto again;
case IP_PROTO_FRAGMENT:
- advance = dissect_frag6(pd, offset, fd, tree);
+ advance = dissect_frag6(pd, offset, fd, tree, &frag);
nxt = pd[poffset = offset];
offset += advance;
goto again;
@@ -357,7 +360,10 @@ again:
#ifdef TEST_FINALHDR
proto_tree_add_item_hidden(ipv6_tree, hf_ipv6_final, poffset, 1, nxt);
#endif
- dissect_icmpv6(pd, offset, fd, tree);
+ if (!frag)
+ dissect_icmpv6(pd, offset, fd, tree);
+ else
+ dissect_data(pd, offset, fd, tree);
break;
case IP_PROTO_NONE:
#ifdef TEST_FINALHDR
@@ -384,13 +390,19 @@ again:
#ifdef TEST_FINALHDR
proto_tree_add_item_hidden(ipv6_tree, hf_ipv6_final, poffset, 1, nxt);
#endif
- dissect_tcp(pd, offset, fd, tree);
+ if (!frag)
+ dissect_tcp(pd, offset, fd, tree);
+ else
+ dissect_data(pd, offset, fd, tree);
break;
case IP_PROTO_UDP:
#ifdef TEST_FINALHDR
proto_tree_add_item_hidden(ipv6_tree, hf_ipv6_final, poffset, 1, nxt);
#endif
- dissect_udp(pd, offset, fd, tree);
+ if (!frag)
+ dissect_udp(pd, offset, fd, tree);
+ else
+ dissect_data(pd, offset, fd, tree);
break;
case IP_PROTO_PIM:
#ifdef TEST_FINALHDR