Module Name:    src
Committed By:   kefren
Date:           Thu Jun 16 19:47:31 UTC 2011

Modified Files:
        src/sys/net: if_ethersubr.c if_mpls.c

Log Message:
use ETHERTYPE_MPLS only for unicast packets (RFC3032)


To generate a diff of this commit:
cvs rdiff -u -r1.187 -r1.188 src/sys/net/if_ethersubr.c
cvs rdiff -u -r1.3 -r1.4 src/sys/net/if_mpls.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_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.187 src/sys/net/if_ethersubr.c:1.188
--- src/sys/net/if_ethersubr.c:1.187	Tue May 24 17:16:43 2011
+++ src/sys/net/if_ethersubr.c	Thu Jun 16 19:47:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.187 2011/05/24 17:16:43 matt Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.188 2011/06/16 19:47:30 kefren Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.187 2011/05/24 17:16:43 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.188 2011/06/16 19:47:30 kefren Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -453,7 +453,8 @@
 
 #ifdef MPLS
 	if (rt0 != NULL && rt_gettag(rt0) != NULL &&
-	    rt_gettag(rt0)->sa_family == AF_MPLS) {
+	    rt_gettag(rt0)->sa_family == AF_MPLS &&
+	    (m->m_flags & (M_MCAST | M_BCAST)) == 0) {
 		union mpls_shim msh;
 		msh.s_addr = MPLS_GETSADDR(rt0);
 		if (msh.shim.label != MPLS_LABEL_IMPLNULL)

Index: src/sys/net/if_mpls.c
diff -u src/sys/net/if_mpls.c:1.3 src/sys/net/if_mpls.c:1.4
--- src/sys/net/if_mpls.c:1.3	Sun Jun 27 13:39:11 2010
+++ src/sys/net/if_mpls.c	Thu Jun 16 19:47:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mpls.c,v 1.3 2010/06/27 13:39:11 kefren Exp $ */
+/*	$NetBSD: if_mpls.c,v 1.4 2011/06/16 19:47:31 kefren Exp $ */
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.3 2010/06/27 13:39:11 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.4 2011/06/16 19:47:31 kefren Exp $");
 
 #include "opt_inet.h"
 #include "opt_mpls.h"
@@ -389,7 +389,8 @@
 	rt->rt_use++;
 
 	msh.s_addr = MPLS_GETSADDR(rt);
-	if (msh.shim.label == MPLS_LABEL_IMPLNULL) {
+	if (msh.shim.label == MPLS_LABEL_IMPLNULL ||
+	    (m->m_flags & (M_MCAST | M_BCAST))) {
 		m_adj(m, sizeof(union mpls_shim));
 		m->m_pkthdr.csum_flags = 0;
 	}

Reply via email to