Module Name:    src
Committed By:   kefren
Date:           Mon Jun 20 09:43:27 UTC 2011

Modified Files:
        src/sys/net: if_loop.c

Log Message:
Avoid computing INET[6] cksums for MPLS packets


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/net/if_loop.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/net/if_loop.c
diff -u src/sys/net/if_loop.c:1.74 src/sys/net/if_loop.c:1.75
--- src/sys/net/if_loop.c:1.74	Fri Jun 17 09:15:24 2011
+++ src/sys/net/if_loop.c	Mon Jun 20 09:43:27 2011
@@ -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);

Reply via email to