diff options
-rw-r--r-- | sys/net/if_mpe.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index c8b34787765..c49f582a7c3 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mpe.c,v 1.16 2009/07/13 12:41:46 dlg Exp $ */ +/* $OpenBSD: if_mpe.c,v 1.17 2009/12/26 12:34:41 claudio Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org> @@ -154,6 +154,14 @@ mpestart(struct ifnet *ifp) if (m == NULL) return; +#ifdef DIAGNOSTIC + if (ifp->if_rdomain != rtable_l2(m->m_pkthdr.rdomain)) { + printf("%s: trying to send packet on wrong domain. " + "if %d vs. mbuf %d\n", ifp->if_xname, + ifp->if_rdomain, rtable_l2(m->m_pkthdr.rdomain)); + } +#endif + #if NBPFILTER > 0 if (ifp->if_bpf) bpf_mtap_af(ifp->if_bpf, AF_INET, m, BPF_DIRECTION_OUT); @@ -167,6 +175,8 @@ mpestart(struct ifnet *ifp) continue; } m->m_pkthdr.rcvif = ifp; + /* XXX assumes MPLS is always in rdomain 0 */ + m->m_pkthdr.rdomain = 0; mpls_output(m, NULL); } } @@ -311,6 +321,10 @@ mpe_input(struct mbuf *m, struct ifnet *ifp, struct sockaddr_mpls *smpls, ip->ip_sum = in_cksum(m, hlen); } + /* new receive if and move into correct rdomain */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.rdomain = ifp->if_rdomain; + #if NBPFILTER > 0 if (ifp && ifp->if_bpf) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); @@ -341,6 +355,10 @@ mpe_input6(struct mbuf *m, struct ifnet *ifp, struct sockaddr_mpls *smpls, ip6hdr->ip6_hlim = ttl; } + /* new receive if and move into correct rdomain */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.rdomain = ifp->if_rdomain; + #if NBPFILTER > 0 if (ifp && ifp->if_bpf) bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_OUT); |