summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/net/if_pppoe.c5
-rw-r--r--sys/net/if_spppsubr.c15
2 files changed, 18 insertions, 2 deletions
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c
index 7bbfd31e0de..e035ea87529 100644
--- a/sys/net/if_pppoe.c
+++ b/sys/net/if_pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppoe.c,v 1.30 2009/03/15 19:40:41 miod Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.31 2009/07/13 16:23:28 claudio Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
@@ -877,6 +877,9 @@ pppoe_output(struct pppoe_softc *sc, struct mbuf *m)
ether_sprintf((unsigned char *)&sc->sc_dest), m->m_pkthdr.len));
m->m_flags &= ~(M_BCAST|M_MCAST);
+ /* encapsulated packet is forced into rdomain of physical interface */
+ m->m_pkthdr.rdomain = sc->sc_eth_if->if_rdomain;
+
sc->sc_sppp.pp_if.if_opackets++;
return (sc->sc_eth_if->if_output(sc->sc_eth_if, m, &dst, NULL));
}
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 44784cd09d5..7f483d74b3f 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.75 2009/02/18 08:36:20 canacar Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.76 2009/07/13 16:23:28 claudio Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -521,6 +521,9 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
return;
}
+ /* mark incomming routing domain */
+ m->m_pkthdr.rdomain = ifp->if_rdomain;
+
if (sp->pp_flags & PP_NOFRAMING) {
memcpy(&ht.protocol, mtod(m, char *), sizeof(ht.protocol));
m_adj(m, 2);
@@ -695,6 +698,16 @@ sppp_output(struct ifnet *ifp, struct mbuf *m,
int s, len, rv = 0;
u_int16_t protocol;
+#ifdef DIAGNOSTIC
+ if (ifp->if_rdomain != m->m_pkthdr.rdomain) {
+ printf("%s: trying to send packet on wrong domain. "
+ "%d vs. %d, AF %d\n", ifp->if_xname, ifp->if_rdomain,
+ m->m_pkthdr.rdomain, dst->sa_family);
+ m_freem (m);
+ return (ENETDOWN);
+ }
+#endif
+
s = splnet();
getmicrouptime(&tv);