summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-06-14 20:58:17 +0000
committerjulian <julian@FreeBSD.org>1998-06-14 20:58:17 +0000
commit7e20c7add6fbd44b2164c1501d1c47f6258b5251 (patch)
tree0b692860e7ae8587eb052e0049d42270cd17cbe4 /sys/net
parenta75c402e98f5929ad6951b05b2999a6ada735c48 (diff)
downloadFreeBSD-src-7e20c7add6fbd44b2164c1501d1c47f6258b5251.zip
FreeBSD-src-7e20c7add6fbd44b2164c1501d1c47f6258b5251.tar.gz
Try narrow down the culprit sending undefined packet types through the loopback
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c9
-rw-r--r--sys/net/if_fddisubr.c6
-rw-r--r--sys/net/if_loop.c15
3 files changed, 22 insertions, 8 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 97b9847..e523232 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_ethersubr.c 8.1 (Berkeley) 6/10/93
- * $Id: if_ethersubr.c,v 1.49 1998/06/12 03:48:07 julian Exp $
+ * $Id: if_ethersubr.c,v 1.50 1998/06/13 02:27:10 julian Exp $
*/
#include "opt_atalk.h"
@@ -357,16 +357,15 @@ ether_output(ifp, m0, dst, rt0)
* on the wire). However, we don't do that here for security
* reasons and compatibility with the original behavior.
*/
- if (ifp->if_flags & IFF_SIMPLEX) {
+ if ((ifp->if_flags & IFF_SIMPLEX) &&
+ (loop_copy != -1)) {
if ((m->m_flags & M_BCAST) || (loop_copy > 0)) {
struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
(void) if_simloop(ifp, n, dst, ETHER_HDR_LEN);
} else if (bcmp(eh->ether_dhost,
eh->ether_shost, ETHER_ADDR_LEN) == 0) {
- if (loop_copy != -1)
- (void) if_simloop(ifp, m, dst,
- ETHER_HDR_LEN);
+ (void) if_simloop(ifp, m, dst, ETHER_HDR_LEN);
return(0); /* XXX */
}
}
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index ee4e847..823bf4d 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* from: if_ethersubr.c,v 1.5 1994/12/13 22:31:45 wollman Exp
- * $Id: if_fddisubr.c,v 1.30 1998/05/21 00:33:16 dg Exp $
+ * $Id: if_fddisubr.c,v 1.31 1998/06/12 03:48:08 julian Exp $
*/
#include "opt_atalk.h"
@@ -301,6 +301,7 @@ fddi_output(ifp, m0, dst, rt0)
case AF_UNSPEC:
{
struct ether_header *eh;
+ loop_copy = -1;
eh = (struct ether_header *)dst->sa_data;
(void)memcpy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
if (*edst & 1)
@@ -386,7 +387,8 @@ fddi_output(ifp, m0, dst, rt0)
* on the wire). However, we don't do that here for security
* reasons and compatibility with the original behavior.
*/
- if (ifp->if_flags & IFF_SIMPLEX) {
+ if ((ifp->if_flags & IFF_SIMPLEX) &&
+ (loop_copy != -1)) {
if ((m->m_flags & M_BCAST) || loop_copy) {
struct mbuf *n = m_copy(m, 0, (int)M_COPYALL);
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index ee77758..9153923 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if_loop.c 8.1 (Berkeley) 6/10/93
- * $Id: if_loop.c,v 1.33 1998/06/12 03:48:09 julian Exp $
+ * $Id: if_loop.c,v 1.34 1998/06/12 20:03:26 julian Exp $
*/
/*
@@ -144,6 +144,19 @@ looutput(ifp, m, dst, rt)
}
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
+#if 1 /* XXX */
+ switch (dst->sa_family) {
+ case AF_INET:
+ case AF_IPX:
+ case AF_NS:
+ case AF_ISO:
+ case AF_APPLETALK:
+ default:
+ printf("looutput: af=%d unexpected", dst->sa_family);
+ m_freem(m);
+ return (EAFNOSUPPORT);
+ }
+#endif
return(if_simloop(ifp, m, dst, 0));
}
OpenPOWER on IntegriCloud