mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 12:28:58 +00:00
Try narrow down the culprit sending undefined packet types through the loopback
This commit is contained in:
parent
6797869271
commit
201c2527a9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=36992
@ -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 */
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ip_output.c 8.3 (Berkeley) 1/21/94
|
||||
* $Id: ip_output.c,v 1.71 1998/06/06 21:49:17 julian Exp $
|
||||
* $Id: ip_output.c,v 1.72 1998/06/12 03:48:19 julian Exp $
|
||||
*/
|
||||
|
||||
#define _IP_VHL
|
||||
@ -1322,6 +1322,14 @@ ip_mloopback(ifp, m, dst, hlen)
|
||||
* packet. For the moment, we'll err on the side
|
||||
* of safety by using if_simloop().
|
||||
*/
|
||||
#if 1 /* XXX */
|
||||
if (dst->sin_family != AF_INET) {
|
||||
printf("ip_mloopback: bad address family %d\n");
|
||||
dst->sin_family);
|
||||
dst->sin_family = AF_INET;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef notdef
|
||||
copym->m_pkthdr.rcvif = ifp;
|
||||
ip_input(copym);
|
||||
|
Loading…
Reference in New Issue
Block a user