summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2008-10-14 20:43:34 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2008-10-14 20:43:34 +0000
commit9c7f701201d27ef2d5880d01479515e3abbcc287 (patch)
tree0f62659741261c12b6be76bd8c4b37ce5772c752 /sys/net
parent842c943d0b9533fb5f723d2e8d941739ee0898a8 (diff)
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@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_mpe.c30
1 files changed, 26 insertions, 4 deletions
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 <pyr@spootnik.org>
@@ -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);
+}