Avoid computing INET[6] cksums for MPLS packets

This commit is contained in:
kefren 2011-06-20 09:43:27 +00:00
parent 0de3f09ec1
commit f33cde5958

View File

@ -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 @@ int
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 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
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 @@ looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
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);