summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/net/if_spppfr.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/net/if_spppfr.c')
-rw-r--r--freebsd/sys/net/if_spppfr.c49
1 files changed, 12 insertions, 37 deletions
diff --git a/freebsd/sys/net/if_spppfr.c b/freebsd/sys/net/if_spppfr.c
index 93bbaeba..d30509d5 100644
--- a/freebsd/sys/net/if_spppfr.c
+++ b/freebsd/sys/net/if_spppfr.c
@@ -27,10 +27,9 @@
#include <rtems/bsd/sys/param.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined(__FreeBSD__)
#include <rtems/bsd/local/opt_inet.h>
#include <rtems/bsd/local/opt_inet6.h>
-#include <rtems/bsd/local/opt_ipx.h>
#endif
#ifdef NetBSD1_3
@@ -47,7 +46,7 @@
#include <sys/sockio.h>
#include <sys/socket.h>
#include <sys/syslog.h>
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3
+#if defined(__FreeBSD__)
#include <sys/random.h>
#endif
#include <sys/malloc.h>
@@ -60,6 +59,7 @@
#endif
#include <net/if.h>
+#include <net/if_var.h>
#include <net/netisr.h>
#include <net/if_types.h>
#include <net/route.h>
@@ -86,11 +86,6 @@
# include <net/ethertypes.h>
#endif
-#ifdef IPX
-#include <netipx/ipx.h>
-#include <netipx/ipx_if.h>
-#endif
-
#include <net/if_sppp.h>
/*
@@ -151,7 +146,7 @@ struct arp_req {
unsigned short ptarget2;
} __packed;
-#if defined(__FreeBSD__) && __FreeBSD__ >= 3 && __FreeBSD_version < 501113
+#if defined(__FreeBSD__) && __FreeBSD_version < 501113
#define SPP_FMT "%s%d: "
#define SPP_ARGS(ifp) (ifp)->if_name, (ifp)->if_unit
#else
@@ -257,9 +252,9 @@ bad: m_freem (m);
switch (proto) {
default:
- ++ifp->if_noproto;
-drop: ++ifp->if_ierrors;
- ++ifp->if_iqdrops;
+ if_inc_counter(ifp, IFCOUNTER_NOPROTO, 1);
+drop: if_inc_counter(ifp, IFCOUNTER_IERRORS, 1);
+ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1);
m_freem (m);
return;
#ifdef INET
@@ -267,16 +262,6 @@ drop: ++ifp->if_ierrors;
isr = NETISR_IP;
break;
#endif
-#ifdef IPX
- case ETHERTYPE_IPX:
- isr = NETISR_IPX;
- break;
-#endif
-#ifdef NETATALK
- case ETHERTYPE_AT:
- isr = NETISR_ATALK;
- break;
-#endif
}
if (! (ifp->if_flags & IFF_UP))
@@ -306,7 +291,7 @@ struct mbuf *sppp_fr_header (struct sppp *sp, struct mbuf *m,
/* Prepend the space for Frame Relay header. */
hlen = (family == AF_INET) ? 4 : 10;
- M_PREPEND (m, hlen, M_DONTWAIT);
+ M_PREPEND (m, hlen, M_NOWAIT);
if (! m)
return 0;
h = mtod (m, u_char*);
@@ -346,21 +331,11 @@ struct mbuf *sppp_fr_header (struct sppp *sp, struct mbuf *m,
h[3] = FR_IP;
return m;
#endif
-#ifdef IPX
- case AF_IPX:
- type = ETHERTYPE_IPX;
- break;
-#endif
#ifdef NS
case AF_NS:
type = 0x8137;
break;
#endif
-#ifdef NETATALK
- case AF_APPLETALK:
- type = ETHERTYPE_AT;
- break;
-#endif
}
h[3] = FR_PADDING;
h[4] = FR_SNAP;
@@ -383,7 +358,7 @@ void sppp_fr_keepalive (struct sppp *sp)
unsigned char *h, *p;
struct mbuf *m;
- MGETHDR (m, M_DONTWAIT, MT_DATA);
+ MGETHDR (m, M_NOWAIT, MT_DATA);
if (! m)
return;
m->m_pkthdr.rcvif = 0;
@@ -421,7 +396,7 @@ void sppp_fr_keepalive (struct sppp *sp)
(u_char) sp->pp_rseq[IDX_LCP]);
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
- ++ifp->if_oerrors;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
}
/*
@@ -503,7 +478,7 @@ static void sppp_fr_arp (struct sppp *sp, struct arp_req *req,
(unsigned char) his_ip_address);
/* Send the Inverse ARP reply. */
- MGETHDR (m, M_DONTWAIT, MT_DATA);
+ MGETHDR (m, M_NOWAIT, MT_DATA);
if (! m)
return;
m->m_pkthdr.len = m->m_len = 10 + sizeof (*reply);
@@ -535,7 +510,7 @@ static void sppp_fr_arp (struct sppp *sp, struct arp_req *req,
reply->ptarget2 = htonl (his_ip_address) >> 16;
if (! IF_HANDOFF_ADJ(&sp->pp_cpq, m, ifp, 3))
- ++ifp->if_oerrors;
+ if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
}
/*