On Mon, Oct 05, 2020 at 07:39:45PM -0700, Stephen Hemminger wrote:
> On Tue, 06 Oct 2020 00:55:19 +0200
> Thomas Monjalon <tho...@monjalon.net> wrote:
> >
> > On 9/1/20 12:47 PM, Michael Pfeiffer wrote:
> > > Currently, rte_ipv4_cksum() and rte_ipv4_udptcp_cksum() assume all IPv4
> > > headers have sizeof(struct rte_ipv4_hdr) bytes. This is not true for
> > > those (rare) packets with IPv4 options. Thus, both IPv4 and TCP/UDP
> > > checksums are calculated wrong.
> > >
> > > This patch fixes the issue by using the actual IPv4 header length from
> > > the packet's IHL field.
> > >
> > > Signed-off-by: Michael Pfeiffer <michael.pfeif...@tu-ilmenau.de>

Acked-by: Olivier Matz <olivier.m...@6wind.com>

> > > -       cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr));
> > > +       cksum = rte_raw_cksum(ipv4_hdr, (ipv4_hdr->version_ihl & 0xf) * 
> > > 4);
> >
> > Truly naive questions:
> > - doesn't it deserve a static inline function rte_ipv4_hdr_len()?
>
> Makes sense to have that.

+1

However it could be in another patch: there are ~15 places where it
could be replaced in dpdk.

Reply via email to