From 9c7f701201d27ef2d5880d01479515e3abbcc287 Mon Sep 17 00:00:00 2001 From: Michele Marchetto Date: Tue, 14 Oct 2008 20:43:34 +0000 Subject: Now mpls_input() handles ipv4 and ipv6 explicit null labels. Added mpe_input6 to manage also ipv6 packets insted of just ipv4 ones. OK claudio@ laurent@ --- sys/net/if_mpe.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index 524a94fbaee..892f20cdb1f 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.9 2008/05/08 09:52:36 pyr Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.10 2008/10/14 20:43:33 michele Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -153,8 +153,8 @@ mpestart(struct ifnet *ifp) return; #if NBPFILTER > 0 - if (ifp->if_bpf) - bpf_mtap_af(ifp->if_bpf, AF_INET, m, BPF_DIRECTION_OUT); + if (ifp->if_bpf) + bpf_mtap_af(ifp->if_bpf, AF_INET, m, BPF_DIRECTION_OUT); #endif ifm = ifp->if_softc; shim.shim_label = ifm->sc_shim.shim_label; @@ -284,7 +284,7 @@ mpe_input(struct mbuf *m, struct ifnet *ifp, struct sockaddr_mpls *smpls, /* label -> AF lookup */ #if NBPFILTER > 0 - if (ifp->if_bpf) + if (ifp && ifp->if_bpf) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); #endif s = splnet(); @@ -295,3 +295,25 @@ mpe_input(struct mbuf *m, struct ifnet *ifp, struct sockaddr_mpls *smpls, schednetisr(NETISR_IP); splx(s); } + +void +mpe_input6(struct mbuf *m, struct ifnet *ifp, struct sockaddr_mpls *smpls, + u_int32_t ttl) +{ + int s; + + /* fixup ttl */ + /* label -> AF lookup */ + +#if NBPFILTER > 0 + if (ifp && ifp->if_bpf) + bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); +#endif + s = splnet(); + /* + * assume we only get fed ipv4 packets for now. + */ + IF_ENQUEUE(&ip6intrq, m); + schednetisr(NETISR_IPV6); + splx(s); +} -- cgit v1.2.3