Module Name: src Committed By: christos Date: Fri Aug 28 17:01:48 UTC 2020
Modified Files: src/sys/netinet: ip_output.c Log Message: Don't cache the sa, because we are dealing with multiple mbufs (from ozaki-r) To generate a diff of this commit: cvs rdiff -u -r1.318 -r1.319 src/sys/netinet/ip_output.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/netinet/ip_output.c diff -u src/sys/netinet/ip_output.c:1.318 src/sys/netinet/ip_output.c:1.319 --- src/sys/netinet/ip_output.c:1.318 Fri Aug 28 02:31:42 2020 +++ src/sys/netinet/ip_output.c Fri Aug 28 13:01:48 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_output.c,v 1.318 2020/08/28 06:31:42 ozaki-r Exp $ */ +/* $NetBSD: ip_output.c,v 1.319 2020/08/28 17:01:48 christos Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -91,7 +91,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.318 2020/08/28 06:31:42 ozaki-r Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.319 2020/08/28 17:01:48 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -690,8 +690,6 @@ sendit: } sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_csum_flags_tx; - sa = (m->m_flags & M_MCAST) ? sintocsa(rdst) : sintocsa(dst); - /* Need to fragment the packet */ if (ntohs(ip->ip_len) > mtu && (m->m_pkthdr.csum_flags & M_CSUM_TSOv4) == 0) { @@ -731,6 +729,8 @@ sendit: } } + sa = (m->m_flags & M_MCAST) ? sintocsa(rdst) : sintocsa(dst); + /* Send it */ if (__predict_false(sw_csum & M_CSUM_TSOv4)) { /* @@ -800,7 +800,8 @@ fragment: } else { KASSERT((m->m_pkthdr.csum_flags & (M_CSUM_UDPv4 | M_CSUM_TCPv4)) == 0); - error = ip_if_output(ifp, m, sa, rt); + error = ip_if_output(ifp, m, (m->m_flags & M_MCAST) ? + sintocsa(rdst) : sintocsa(dst), rt); } } if (error == 0) {