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_fddisubr.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_fddisubr.c')
-rw-r--r-- | sys/net/if_fddisubr.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c index a43177f5089..f1c4d775d9f 100644 --- a/sys/net/if_fddisubr.c +++ b/sys/net/if_fddisubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_fddisubr.c,v 1.55 2009/06/05 00:05:21 claudio Exp $ */ +/* $OpenBSD: if_fddisubr.c,v 1.56 2009/07/08 15:01:50 claudio Exp $ */ /* $NetBSD: if_fddisubr.c,v 1.5 1996/05/07 23:20:21 christos Exp $ */ /* @@ -148,6 +148,15 @@ fddi_output(ifp0, m0, dst, rt0) short mflags; struct ifnet *ifp = ifp0; +#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); + senderr(ENETDOWN); + } +#endif + #if NCARP > 0 if (ifp->if_type == IFT_CARP) { struct ifaddr *ifa; @@ -383,6 +392,9 @@ fddi_input(ifp, fh, m) m_freem(m); return; } + /* mark incomming routing domain */ + m->m_pkthdr.rdomain = ifp->if_rdomain; + ifp->if_ibytes += m->m_pkthdr.len + sizeof (*fh); if (bcmp((caddr_t)fddibroadcastaddr, (caddr_t)fh->fddi_dhost, sizeof(fddibroadcastaddr)) == 0) |