diff options
Diffstat (limited to 'sys/netmpls')
-rw-r--r-- | sys/netmpls/mpls.h | 4 | ||||
-rw-r--r-- | sys/netmpls/mpls_input.c | 29 |
2 files changed, 30 insertions, 3 deletions
diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h index 8858864d74b..0ad5fe11457 100644 --- a/sys/netmpls/mpls.h +++ b/sys/netmpls/mpls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls.h,v 1.11 2008/05/23 16:03:03 thib Exp $ */ +/* $OpenBSD: mpls.h,v 1.12 2008/10/14 20:43:33 michele Exp $ */ /* * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project. @@ -152,6 +152,8 @@ struct mpe_softc { void mpe_input(struct mbuf *, struct ifnet *, struct sockaddr_mpls *, u_int32_t); +void mpe_input6(struct mbuf *, struct ifnet *, struct sockaddr_mpls *, + u_int32_t); extern int mpls_raw_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *, struct proc *); diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c index e95c19db693..39ff4c621b6 100644 --- a/sys/netmpls/mpls_input.c +++ b/sys/netmpls/mpls_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls_input.c,v 1.13 2008/05/23 16:06:29 thib Exp $ */ +/* $OpenBSD: mpls_input.c,v 1.14 2008/10/14 20:43:33 michele Exp $ */ /* * Copyright (c) 2008 Claudio Jeker <claudio@openbsd.org> @@ -128,7 +128,32 @@ mpls_input(struct mbuf *m) smpls->smpls_in_ifindex); #endif - rt = rtalloc1(smplstosa(smpls),1, 0); + if (ntohl(smpls->smpls_in_label) < MPLS_LABEL_RESERVED_MAX) { + + hasbos = MPLS_BOS_ISSET(shim->shim_label); + m = mpls_shim_pop(m); + shim = mtod(m, struct shim_hdr *); + + switch (ntohl(smpls->smpls_in_label)) { + + case MPLS_LABEL_IPV4NULL: + if (hasbos) { + mpe_input(m, NULL, smpls, ttl); + goto done; + } else + continue; + + case MPLS_LABEL_IPV6NULL: + if (hasbos) { + mpe_input6(m, NULL, smpls, ttl); + goto done; + } else + continue; + } + /* Other cases are not handled for now */ + } + + rt = rtalloc1(smplstosa(smpls), 1, 0); if (rt == NULL) { /* no entry for this label */ |