summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfgsch <fgsch@openbsd.org>2000-01-17 00:34:00 +0000
committerfgsch <fgsch@openbsd.org>2000-01-17 00:34:00 +0000
commit6e319c86fa2297c9a86f7d3105840a10d0cc18bb (patch)
tree6a641bccfe4ec588fc75a16ac060b7cdd5551e16
parentsome more paranoid checks, shorter trap desriptions (diff)
downloadwireguard-openbsd-6e319c86fa2297c9a86f7d3105840a10d0cc18bb.tar.xz
wireguard-openbsd-6e319c86fa2297c9a86f7d3105840a10d0cc18bb.zip
Add sysctl vars for checksum, forwarding and netbios.
Remove ancient code from ipx_input. ipxrecvspace/ipxsendspace changed to ipx_xxx to match netinet counterparts.
-rw-r--r--sys/netipx/ipx.h4
-rw-r--r--sys/netipx/ipx_usrreq.c56
-rw-r--r--sys/netipx/ipx_var.h14
3 files changed, 30 insertions, 44 deletions
diff --git a/sys/netipx/ipx.h b/sys/netipx/ipx.h
index b78c075d87e..01bd8a0a9e8 100644
--- a/sys/netipx/ipx.h
+++ b/sys/netipx/ipx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx.h,v 1.11 2000/01/13 07:10:36 fgsch Exp $ */
+/* $OpenBSD: ipx.h,v 1.12 2000/01/17 00:34:00 fgsch Exp $ */
/*-
*
@@ -201,6 +201,8 @@ struct ipx {
#define sipxtosa(a) ((struct sockaddr *)(a))
extern int ipxcksum;
+extern int ipxforwarding;
+extern int ipxnetbios;
extern struct domain ipxdomain;
extern struct sockaddr_ipx ipx_netmask;
extern struct sockaddr_ipx ipx_hostmask;
diff --git a/sys/netipx/ipx_usrreq.c b/sys/netipx/ipx_usrreq.c
index 693ad759d2c..0911fa457af 100644
--- a/sys/netipx/ipx_usrreq.c
+++ b/sys/netipx/ipx_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx_usrreq.c,v 1.7 2000/01/15 18:52:14 fgsch Exp $ */
+/* $OpenBSD: ipx_usrreq.c,v 1.8 2000/01/17 00:34:00 fgsch Exp $ */
/*-
*
@@ -74,8 +74,8 @@
int noipxRoute;
-int ipxsendspace = IPXSNDQ;
-int ipxrecvspace = IPXRCVQ;
+int ipx_sendspace = IPXSNDQ;
+int ipx_recvspace = IPXRCVQ;
/*
* This may also be called for raw listeners.
@@ -269,37 +269,6 @@ ipx_output(m0, va_alist)
* would require 3 subroutine calls.
*/
ro = &ipxp->ipxp_route;
-#ifdef ancient_history
- /*
- * I think that this will all be handled in ipx_pcbconnect!
- */
- if (ro->ro_rt) {
- if(ipx_neteq(ipxp->ipxp_lastdst, ipx->ipx_dna)) {
- /*
- * This assumes we have no GH type routes
- */
- if (ro->ro_rt->rt_flags & RTF_HOST) {
- if (!ipx_hosteq(ipxp->ipxp_lastdst, ipx->ipx_dna))
- goto re_route;
-
- }
- if ((ro->ro_rt->rt_flags & RTF_GATEWAY) == 0) {
- register struct ipx_addr *dst =
- &satoipx_addr(ro->ro_dst);
- dst->ipx_host = ipx->ipx_dna.ipx_host;
- }
- /*
- * Otherwise, we go through the same gateway
- * and dst is already set up.
- */
- } else {
- re_route:
- RTFREE(ro->ro_rt);
- ro->ro_rt = (struct rtentry *)0;
- }
- }
- ipxp->ipxp_lastdst = ipx->ipx_dna;
-#endif /* ancient_history */
if (noipxRoute)
ro = 0;
return (ipx_outputfl(m, ro, so->so_options & SO_BROADCAST));
@@ -452,7 +421,7 @@ ipx_usrreq(so, req, m, nam, control)
error = ipx_pcballoc(so, &ipxcbtable);
if (error)
break;
- error = soreserve(so, ipxsendspace, ipxrecvspace);
+ error = soreserve(so, ipx_sendspace, ipx_recvspace);
if (error)
break;
break;
@@ -607,7 +576,7 @@ ipx_raw_usrreq(so, req, m, nam, control)
error = ipx_pcballoc(so, &ipxrawcbtable);
if (error)
break;
- error = soreserve(so, ipxsendspace, ipxrecvspace);
+ error = soreserve(so, ipx_sendspace, ipx_recvspace);
if (error)
break;
ipxp = sotoipxpcb(so);
@@ -634,14 +603,23 @@ ipx_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
return (ENOTDIR);
switch (name[0]) {
+ case IPXCTL_CHECKSUM:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &ipxcksum));
+ case IPXCTL_FORWARDING:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &ipxforwarding));
+ case IPXCTL_NETBIOS:
+ return (sysctl_int(oldp, oldlenp, newp, newlen,
+ &ipxnetbios));
case IPXCTL_RECVSPACE:
return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipxrecvspace));
+ &ipx_recvspace));
case IPXCTL_SENDSPACE:
return (sysctl_int(oldp, oldlenp, newp, newlen,
- &ipxsendspace));
+ &ipx_sendspace));
default:
return (ENOPROTOOPT);
}
- /* NOT REACHED */
+ /* NOTREACHED */
}
diff --git a/sys/netipx/ipx_var.h b/sys/netipx/ipx_var.h
index 270e0692c13..7993e0d3784 100644
--- a/sys/netipx/ipx_var.h
+++ b/sys/netipx/ipx_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipx_var.h,v 1.4 2000/01/11 19:52:16 fgsch Exp $ */
+/* $OpenBSD: ipx_var.h,v 1.5 2000/01/17 00:34:00 fgsch Exp $ */
/*-
*
@@ -64,12 +64,18 @@ struct ipxstat {
* Names for IPX sysctl objects.
*/
-#define IPXCTL_RECVSPACE 1
-#define IPXCTL_SENDSPACE 2
-#define IPXCTL_MAXID 3
+#define IPXCTL_CHECKSUM 1
+#define IPXCTL_FORWARDING 2
+#define IPXCTL_NETBIOS 3
+#define IPXCTL_RECVSPACE 4
+#define IPXCTL_SENDSPACE 5
+#define IPXCTL_MAXID 6
#define IPXCTL_NAMES { \
{ 0, 0}, \
+ { "checksum", CTLTYPE_INT }, \
+ { "forwarding", CTLTYPE_INT }, \
+ { "netbios", CTLTYPE_INT }, \
{ "recvspace", CTLTYPE_INT }, \
{ "sendspace", CTLTYPE_INT }, \
}