diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-07-08 15:01:51 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-07-08 15:01:51 +0000 |
commit | adaaa9d9490a77fc421f46a2b0f652b6d9c9199e (patch) | |
tree | 69baf7ae2ce5c51675555912d8db1efdb10a26f8 /sys/net/if_sl.c | |
parent | 9e4037e58e8cbde3240f2ea14f9bdc9d0046947c (diff) |
Add the same routing domain assignments and checks into the not so used
protocols as it is currently in if_ethersubr.c. OK reyk@
Diffstat (limited to 'sys/net/if_sl.c')
-rw-r--r-- | sys/net/if_sl.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c index 35966944a24..200e0c210ae 100644 --- a/sys/net/if_sl.c +++ b/sys/net/if_sl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sl.c,v 1.36 2008/10/22 23:04:45 mpf Exp $ */ +/* $OpenBSD: if_sl.c,v 1.37 2009/07/08 15:01:50 claudio Exp $ */ /* $NetBSD: if_sl.c,v 1.39.4.1 1996/06/02 16:26:31 thorpej Exp $ */ /* @@ -429,6 +429,16 @@ sloutput(ifp, m, dst, rtp) return (EAFNOSUPPORT); } +#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 + if (sc->sc_ttyp == NULL) { m_freem(m); return (ENETDOWN); /* sort of */ @@ -747,6 +757,9 @@ slinput(c, tp) } c &= TTY_CHARMASK; + /* mark incomming routing domain */ + m->m_pkthdr.rdomain = sc->sc_if.if_rdomain; + ++sc->sc_if.if_ibytes; if (sc->sc_if.if_flags & IFF_DEBUG) { |