DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment extension header
@ 2015-09-02 14:13 Piotr
  2015-09-03 15:23 ` Dumitrescu, Cristian
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Piotr @ 2015-09-02 14:13 UTC (permalink / raw)
  To: dev

From: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>

Previous implementation won't work on every environment. The order of
allocation of bit-fields within a unit (high-order to low-order or
low-order to high-order) is implementation-defined.
Solution: used bytes instead of bit fields.

Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
---
 lib/librte_ip_frag/rte_ipv6_fragmentation.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/librte_ip_frag/rte_ipv6_fragmentation.c b/lib/librte_ip_frag/rte_ipv6_fragmentation.c
index 0e32aa8..7342421 100644
--- a/lib/librte_ip_frag/rte_ipv6_fragmentation.c
+++ b/lib/librte_ip_frag/rte_ipv6_fragmentation.c
@@ -65,10 +65,8 @@ __fill_ipv6hdr_frag(struct ipv6_hdr *dst,
 
 	fh = (struct ipv6_extension_fragment *) ++dst;
 	fh->next_header = src->proto;
-	fh->reserved1   = 0;
-	fh->frag_offset = rte_cpu_to_be_16(fofs);
-	fh->reserved2   = 0;
-	fh->more_frags  = rte_cpu_to_be_16(mf);
+	fh->reserved1 = 0;
+	fh->frag_data = rte_cpu_to_be_16((fofs & ~IPV6_HDR_FO_MASK) | mf);
 	fh->id = 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-10-08 11:25 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-02 14:13 [dpdk-dev] [PATCH 1/1] ip_frag: fix creating ipv6 fragment extension header Piotr
2015-09-03 15:23 ` Dumitrescu, Cristian
2015-09-04 15:51 ` Ananyev, Konstantin
2015-09-07 11:21   ` Dumitrescu, Cristian
2015-09-07 11:23     ` Ananyev, Konstantin
2015-09-07 11:24       ` Dumitrescu, Cristian
2015-09-08 14:07 ` [dpdk-dev] [PATCH v2 " Piotr Azarewicz
2015-09-09 10:40   ` Dumitrescu, Cristian
2015-09-09 10:47   ` [dpdk-dev] FW: " Ananyev, Konstantin
2015-09-09 13:39   ` [dpdk-dev] [PATCH v3 " Piotr Azarewicz
2015-09-10  7:09     ` [dpdk-dev] [PATCH v4 " Piotr Azarewicz
2015-09-10  8:35       ` Ananyev, Konstantin
2015-09-10 12:24       ` Dumitrescu, Cristian
2015-10-08 11:24         ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).