eal: fix symbol map version number
[dpdk.git] / lib / librte_ip_frag / rte_ipv4_reassembly.c
index dc4d036..26d07f9 100644 (file)
@@ -63,7 +63,9 @@ ipv4_frag_reassemble(const struct ip_frag_pkt *fp)
                        /* previous fragment found. */
                        if(fp->frags[i].ofs + fp->frags[i].len == ofs) {
 
-                               ip_frag_chain(fp->frags[i].mb, m);
+                               /* adjust start of the last fragment data. */
+                               rte_pktmbuf_adj(m, (uint16_t)(m->l2_len + m->l3_len));
+                               rte_pktmbuf_chain(fp->frags[i].mb, m);
 
                                /* update our last fragment and offset. */
                                m = fp->frags[i].mb;
@@ -78,15 +80,15 @@ ipv4_frag_reassemble(const struct ip_frag_pkt *fp)
        }
 
        /* chain with the first fragment. */
-       ip_frag_chain(fp->frags[IP_FIRST_FRAG_IDX].mb, m);
+       rte_pktmbuf_adj(m, (uint16_t)(m->l2_len + m->l3_len));
+       rte_pktmbuf_chain(fp->frags[IP_FIRST_FRAG_IDX].mb, m);
        m = fp->frags[IP_FIRST_FRAG_IDX].mb;
 
        /* update mbuf fields for reassembled packet. */
        m->ol_flags |= PKT_TX_IP_CKSUM;
 
        /* update ipv4 header for the reassmebled packet */
-       ip_hdr = (struct ipv4_hdr*)(rte_pktmbuf_mtod(m, uint8_t *) +
-               m->l2_len);
+       ip_hdr = rte_pktmbuf_mtod_offset(m, struct ipv4_hdr *, m->l2_len);
 
        ip_hdr->total_length = rte_cpu_to_be_16((uint16_t)(fp->total_size +
                m->l3_len));