[PATCH] net: fix IPv4 cksum simple function
David Marchand
david.marchand at redhat.com
Wed Nov 6 21:22:50 CET 2024
On Tue, Nov 5, 2024 at 10:09 AM Morten Brørup <mb at smartsharesystems.com> wrote:
>
> > From: David Marchand [mailto:david.marchand at redhat.com]
> > Sent: Tuesday, 5 November 2024 09.59
> >
> > The new function breaks compilation with -Wcast-align.
> >
> > In file included from /home/runner/work/ovs/ovs/dpdk-
> > dir/include/rte_ip.h:9:
> > /home/runner/work/ovs/ovs/dpdk-dir/include/rte_ip4.h:191:10:
> > error: cast from 'const uint8_t *' (aka 'const unsigned char *')
> > to 'const unaligned_uint16_t *' (aka 'const unsigned short *')
> > increases required alignment from 1 to 2 [-Werror,-Wcast-align]
> > v16_h = (const unaligned_uint16_t *)&ipv4_hdr->version_ihl;
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > Fix this by aligning rte_ipv4_hdr to two bytes, and point at the start
> > of the structure rather than the first field (which happens to be 1
> > byte
> > large).
> >
> > Fixes: f9e1d67f237a ("net: add IPv4 cksum function for simple cases")
> >
> > Signed-off-by: David Marchand <david.marchand at redhat.com>
Applied, thanks.
--
David Marchand
More information about the dev
mailing list