Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Avoid putting implicit null labels on the wire
details: https://anonhg.NetBSD.org/src/rev/0c6b07d74509
branches: trunk
changeset: 766893:0c6b07d74509
user: kefren <kefren%NetBSD.org@localhost>
date: Sun Jul 03 18:46:12 2011 +0000
description:
Avoid putting implicit null labels on the wire
diffstat:
sys/net/if_mpls.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diffs (38 lines):
diff -r f891db9148ef -r 0c6b07d74509 sys/net/if_mpls.c
--- a/sys/net/if_mpls.c Sun Jul 03 18:15:18 2011 +0000
+++ b/sys/net/if_mpls.c Sun Jul 03 18:46:12 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mpls.c,v 1.7 2011/06/22 19:08:29 kefren Exp $ */
+/* $NetBSD: if_mpls.c,v 1.8 2011/07/03 18:46:12 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.7 2011/06/22 19:08:29 kefren Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mpls.c,v 1.8 2011/07/03 18:46:12 kefren Exp $");
#include "opt_inet.h"
#include "opt_mpls.h"
@@ -218,7 +218,8 @@
while (psize <= rt_gettag(rt)->sa_len - sizeof(mh)) {
pms++;
- if ((m = mpls_prepend_shim(m, &mh)) == NULL)
+ if (mh.shim.label != MPLS_LABEL_IMPLNULL &&
+ ((m = mpls_prepend_shim(m, &mh)) == NULL))
return ENOBUFS;
memset(&mh, 0, sizeof(mh));
mh.s_addr = ntohl(pms->s_addr);
@@ -392,7 +393,8 @@
tshim.s_addr = ntohl(htag->s_addr);
tshim.shim.bos = tshim.shim.exp = 0;
tshim.shim.ttl = mpls_defttl;
- if ((m = mpls_prepend_shim(m, &tshim)) == NULL)
+ if (tshim.shim.label != MPLS_LABEL_IMPLNULL &&
+ ((m = mpls_prepend_shim(m, &tshim)) == NULL))
return ENOBUFS;
psize += sizeof(tshim);
}
Home |
Main Index |
Thread Index |
Old Index