Date: Thu, 17 Oct 2019 17:19:16 +0000 (UTC) From: Conrad Meyer <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353688 - head/sys/net Message-ID: <201910171719.x9HHJGKF013980@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Thu Oct 17 17:19:16 2019 New Revision: 353688 URL: https://svnweb.freebsd.org/changeset/base/353688 Log: debugnet(4): Check hardware-validated UDP checksums Similar to INET checksums, lazily validate UDP checksums when the driver has already performed the check for us. Like debugnet(4) INET checksums, validation in software is left as future work. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21745 Modified: head/sys/net/debugnet_inet.c Modified: head/sys/net/debugnet_inet.c ============================================================================== --- head/sys/net/debugnet_inet.c Thu Oct 17 17:02:50 2019 (r353687) +++ head/sys/net/debugnet_inet.c Thu Oct 17 17:19:16 2019 (r353688) @@ -196,6 +196,15 @@ debugnet_handle_ip(struct debugnet_pcb *pcb, struct mb return; } + if ((m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) != 0) { + if ((m->m_pkthdr.csum_flags & CSUM_DATA_VALID) == 0) { + DNETDEBUG("bad UDP checksum\n"); + return; + } + } else { + /* XXX */ ; + } + /* UDP custom is to have packet length not include IP header. */ ip->ip_len -= hlen;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201910171719.x9HHJGKF013980>