Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't cache the sa, because we are dealing with ...



details:   https://anonhg.NetBSD.org/src/rev/3123a8a40c64
branches:  trunk
changeset: 937897:3123a8a40c64
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Aug 28 17:01:48 2020 +0000

description:
Don't cache the sa, because we are dealing with multiple mbufs (from ozaki-r)

diffstat:

 sys/netinet/ip_output.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (46 lines):

diff -r a1832e2313b7 -r 3123a8a40c64 sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Fri Aug 28 16:13:48 2020 +0000
+++ b/sys/netinet/ip_output.c   Fri Aug 28 17:01:48 2020 +0000
@@ -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 @@
        }
        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 @@
                }
        }
 
+       sa = (m->m_flags & M_MCAST) ? sintocsa(rdst) : sintocsa(dst);
+
        /* Send it */
        if (__predict_false(sw_csum & M_CSUM_TSOv4)) {
                /*
@@ -800,7 +800,8 @@
                } 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) {



Home | Main Index | Thread Index | Old Index