goto error_remove_tracker;
hlen = frag->hlen;
- ip_hdr_offset = frag->ip_hdr_offset;
+ ip_hdr_offset = tracker->ip_hdr_offset;
/* This is the start of the fragmentable portion of the
* first packet. All fragment offsets are relative to
* this. */
- fragmentable_offset = frag->ip_hdr_offset + frag->hlen;
+ fragmentable_offset = tracker->ip_hdr_offset + frag->hlen;
fragmentable_len = frag->data_len;
}
else {
frag->pkt + frag->frag_hdr_offset + sizeof(IPV6FragHdr),
frag->data_len) == -1)
goto error_remove_tracker;
- ip_hdr_offset = frag->ip_hdr_offset;
+ ip_hdr_offset = tracker->ip_hdr_offset;
/* This is the start of the fragmentable portion of the
* first packet. All fragment offsets are relative to
prev_offset = frag->offset;
}
- rp->ip6h = (IPV6Hdr *)(GET_PKT_DATA(rp) + ip_hdr_offset);
+ rp->ip6h = (IPV6Hdr *)(GET_PKT_DATA(rp) + tracker->ip_hdr_offset);
DEBUG_VALIDATE_BUG_ON(unfragmentable_len > UINT16_MAX - fragmentable_len);
rp->ip6h->s_ip6_plen = htons(fragmentable_len + unfragmentable_len);
/* if we have no unfragmentable part, so no ext hdrs before the frag
new->offset = frag_offset + ltrim;
new->data_offset = data_offset;
new->data_len = data_len - ltrim;
- new->ip_hdr_offset = ip_hdr_offset;
new->frag_hdr_offset = frag_hdr_offset;
new->more_frags = more_frags;
#ifdef DEBUG
new->pcap_cnt = pcap_cnt;
#endif
- if (frag_offset == 0) {
+ if (new->offset == 0) {
+ tracker->ip_hdr_offset = ip_hdr_offset;
tracker->datalink = p->datalink;
}
uint8_t more_frags:4; /**< More frags? */
uint8_t skip:4; /**< Skip this fragment during re-assembly. */
- uint16_t ip_hdr_offset; /**< Offset in the packet where the IP
- * header starts. */
uint16_t frag_hdr_offset; /**< Offset in the packet where the frag
* header starts. */
* this tracker. */
uint16_t vlan_id[VLAN_MAX_LAYERS]; /**< VLAN ID tracker applies to. */
+ uint16_t ip_hdr_offset; /**< Offset in the packet where the IP
+ * header starts. */
uint32_t id; /**< IP ID for this tracker. 32 bits for IPv6, 16
* for IPv4. */