Source-Changes-HG archive

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

[src/trunk]: src/sys/net Avoid computing INET[6] cksums for MPLS packets



details:   https://anonhg.NetBSD.org/src/rev/ee22c8fbf2a6
branches:  trunk
changeset: 766298:ee22c8fbf2a6
user:      kefren <kefren%NetBSD.org@localhost>
date:      Mon Jun 20 09:43:27 2011 +0000

description:
Avoid computing INET[6] cksums for MPLS packets

diffstat:

 sys/net/if_loop.c |  31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diffs (66 lines):

diff -r 56ec7330a3e0 -r ee22c8fbf2a6 sys/net/if_loop.c
--- a/sys/net/if_loop.c Mon Jun 20 09:27:43 2011 +0000
+++ b/sys/net/if_loop.c Mon Jun 20 09:43:27 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_loop.c,v 1.74 2011/06/17 09:15:24 kefren Exp $      */
+/*     $NetBSD: if_loop.c,v 1.75 2011/06/20 09:43:27 kefren Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.74 2011/06/17 09:15:24 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.75 2011/06/20 09:43:27 kefren Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -217,7 +217,7 @@
 looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
     struct rtentry *rt)
 {
-       int s, isr;
+       int s, isr = -1;
        struct ifqueue *ifq = NULL;
        int csum_flags;
 
@@ -268,6 +268,19 @@
 
        m_tag_delete_nonpersistent(m);
 
+#ifdef MPLS
+       if (rt != NULL && rt_gettag(rt) != NULL &&
+           rt_gettag(rt)->sa_family == AF_MPLS &&
+           (m->m_flags & (M_MCAST | M_BCAST)) == 0) {
+               union mpls_shim msh;
+               msh.s_addr = MPLS_GETSADDR(rt);
+               if (msh.shim.label != MPLS_LABEL_IMPLNULL) {
+                       ifq = &mplsintrq;
+                       isr = NETISR_MPLS;
+               }
+       }
+       if (isr != NETISR_MPLS)
+#endif
        switch (dst->sa_family) {
 
 #ifdef INET
@@ -320,18 +333,6 @@
                m_freem(m);
                return (EAFNOSUPPORT);
        }
-#ifdef MPLS
-       if (rt != NULL && rt_gettag(rt) != NULL &&
-           rt_gettag(rt)->sa_family == AF_MPLS &&
-           (m->m_flags & (M_MCAST | M_BCAST)) == 0) {
-               union mpls_shim msh;
-               msh.s_addr = MPLS_GETSADDR(rt);
-               if (msh.shim.label != MPLS_LABEL_IMPLNULL) {
-                       ifq = &mplsintrq;
-                       isr = NETISR_MPLS;
-               }
-       }
-#endif
        s = splnet();
        if (IF_QFULL(ifq)) {
                IF_DROP(ifq);



Home | Main Index | Thread Index | Old Index