#include <stdint.h>
#include <netinet/in.h>
-#include <rte_memcpy.h>
#include <rte_byteorder.h>
#include <rte_mbuf.h>
{
/* workaround gcc strict-aliasing warning */
uintptr_t ptr = (uintptr_t)buf;
- const uint16_t *u16 = (const uint16_t *)ptr;
+ typedef uint16_t __attribute__((__may_alias__)) u16_p;
+ const u16_p *u16 = (const u16_p *)ptr;
while (len >= (sizeof(*u16) * 4)) {
sum += u16[0];
{
uint16_t cksum;
cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct ipv4_hdr));
- return ((cksum == 0xffff) ? cksum : ~cksum);
+ return (cksum == 0xffff) ? cksum : ~cksum;
}
/**