Date: Thu, 18 Jun 2020 10:38:02 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r362311 - stable/12/sys/dev/mlx5/mlx5_en Message-ID: <202006181038.05IAc2Hm075664@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Thu Jun 18 10:38:02 2020 New Revision: 362311 URL: https://svnweb.freebsd.org/changeset/base/362311 Log: MFC r362045: Make sure packets generated by raw IP code is let through by mlx5en(4). Allow the TCP header to reside in the mbuf following the IP header. Else such packets will get dropped. Backtrace: mlx5e_sq_xmit() mlx5e_xmit() ether_output_frame() ether_output() ip_output_send() ip_output() rip_output() sosend_generic() sosend() kern_sendit() sendit() sys_sendto() amd64_syscall() fast_syscall_common() Sponsored by: Mellanox Technologies Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:31:21 2020 (r362310) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Jun 18 10:38:02 2020 (r362311) @@ -281,9 +281,15 @@ mlx5e_get_full_header_size(const struct mbuf *mb) default: return (0); } - if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) - return (0); - th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + if (unlikely(mb->m_len < eth_hdr_len + sizeof(*th))) { + const struct mbuf *m_th = mb->m_next; + if (unlikely(mb->m_len != eth_hdr_len || + m_th == NULL || m_th->m_len < sizeof(*th))) + return (0); + th = (const struct tcphdr *)(m_th->m_data); + } else { + th = (const struct tcphdr *)(mb->m_data + eth_hdr_len); + } tcp_hlen = th->th_off << 2; eth_hdr_len += tcp_hlen; done:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006181038.05IAc2Hm075664>