This commit is contained in:
christos 1998-12-10 11:01:01 +00:00
parent 03f9abe51f
commit c7578c510a
2 changed files with 57 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ppp.c,v 1.47 1998/09/03 14:12:36 christos Exp $ */
/* $NetBSD: if_ppp.c,v 1.48 1998/12/10 11:01:01 christos Exp $ */
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
/*
@ -83,6 +83,7 @@
#include "opt_inet.h"
#include "opt_gateway.h"
#include "opt_ppp.h"
#include <sys/param.h>
#include <sys/proc.h>
@ -109,6 +110,11 @@
#include <netinet/ip.h>
#endif
#if IPX
#include <netipx/ipx.h>
#include <netipx/ipx_if.h>
#endif
#include "bpfilter.h"
#if NBPFILTER > 0
#include <sys/time.h>
@ -563,13 +569,20 @@ pppsioctl(ifp, cmd, data)
break;
case SIOCSIFADDR:
if (ifa->ifa_addr->sa_family != AF_INET)
error = EAFNOSUPPORT;
break;
case SIOCSIFDSTADDR:
if (ifa->ifa_addr->sa_family != AF_INET)
switch(ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
break;
#endif
#ifdef IPX
case AF_IPX:
break;
#endif
default:
error = EAFNOSUPPORT;
break;
}
break;
case SIOCSIFMTU:
@ -682,6 +695,19 @@ pppoutput(ifp, m0, dst, rtp)
if (ip->ip_tos & IPTOS_LOWDELAY)
m0->m_flags |= M_HIGHPRI;
break;
#endif
#ifdef IPX
case AF_IPX:
/*
* This is pretty bogus.. We dont have an ipxcp module in pppd
* yet to configure the link parameters. Sigh. I guess a
* manual ifconfig would do.... -Peter
*/
address = PPP_ALLSTATIONS;
control = PPP_UI;
protocol = PPP_IPX;
mode = NPMODE_PASS;
break;
#endif
case AF_UNSPEC:
address = PPP_ADDRESS(dst->sa_data);
@ -1449,6 +1475,25 @@ ppp_inproc(sc, m)
break;
#endif
#ifdef IPX
case PPP_IPX:
/*
* IPX packet - take off the ppp header and pass it up to IPX.
*/
if ((sc->sc_if.if_flags & IFF_UP) == 0
/* XXX: || sc->sc_npmode[NP_IPX] != NPMODE_PASS*/) {
/* interface is down - drop the packet. */
m_freem(m);
return;
}
m->m_pkthdr.len -= PPP_HDRLEN;
m->m_data += PPP_HDRLEN;
m->m_len -= PPP_HDRLEN;
schednetisr(NETISR_IPX);
inq = &ipxintrq;
break;
#endif
default:
/*
* Some other protocol - place on input queue for read().

View File

@ -1,4 +1,4 @@
/* $NetBSD: ip_fil.h,v 1.27 1998/11/22 15:17:19 mrg Exp $ */
/* $NetBSD: ip_fil.h,v 1.28 1998/12/10 11:01:41 christos Exp $ */
/*
* Copyright (C) 1993-1998 by Darren Reed.
@ -14,8 +14,11 @@
#ifndef _NETINET_IP_FIL_H_
#define _NETINET_IP_FIL_H_
#if defined(__NetBSD__) && defined(PFIL_HOOKS)
#include "opt_pfil_hooks.h"
#if defined(__NetBSD__)
# if defined(PFIL_HOOKS)
# include "opt_pfil_hooks.h"
# endif
# include "opt_ipfilter_log.h"
#endif
/*