From 51b1a2f219c01a61761ff951922c685c0f760512 Mon Sep 17 00:00:00 2001 From: Michele Marchetto Date: Wed, 29 Apr 2009 19:26:53 +0000 Subject: Split up functionalities between mpls_input and mpls_output. The former is responsible to handle packets destined to localhost, the latter handles packet that have to be forwarded or the ones originated from localhost. "i like it" claudio@ --- sys/netmpls/mpls_input.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sys/netmpls/mpls_input.c') diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c index 1a9c3156f93..1e34fa4d989 100644 --- a/sys/netmpls/mpls_input.c +++ b/sys/netmpls/mpls_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls_input.c,v 1.20 2009/04/28 12:07:43 michele Exp $ */ +/* $OpenBSD: mpls_input.c,v 1.21 2009/04/29 19:26:52 michele Exp $ */ /* * Copyright (c) 2008 Claudio Jeker @@ -232,13 +232,10 @@ mpls_input(struct mbuf *m) goto done; } - switch (rt_mpls->mpls_operation & (MPLS_OP_PUSH | MPLS_OP_POP | - MPLS_OP_SWAP)){ - - case MPLS_OP_POP: + if (rt_mpls->mpls_operation & MPLS_OP_POP) { hasbos = MPLS_BOS_ISSET(shim->shim_label); - m = mpls_shim_pop(m); if (hasbos) { + m = mpls_shim_pop(m); #if NMPE > 0 if (rt->rt_ifp->if_type == IFT_MPLS) { mpe_input(m, rt->rt_ifp, smpls, ttl); @@ -249,21 +246,8 @@ mpls_input(struct mbuf *m) m_freem(m); goto done; } - break; - case MPLS_OP_PUSH: - m = mpls_shim_push(m, rt_mpls); - break; - case MPLS_OP_SWAP: - m = mpls_shim_swap(m, rt_mpls); - break; - default: - m_freem(m); - goto done; } - if (m == NULL) - goto done; - /* refetch label */ shim = mtod(m, struct shim_hdr *); ifp = rt->rt_ifp; -- cgit v1.2.3