summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-07-11 16:32:50 +0000
committerwollman <wollman@FreeBSD.org>1996-07-11 16:32:50 +0000
commit36ac1a02631aaa05aa36416979316960c69d3f06 (patch)
tree8c5d769659a79218ab7f5a25af062167216d07a1 /sys/net
parentd2bef1a0e554bc9afc083cd2a8a85c8e04c4fd2c (diff)
downloadFreeBSD-src-36ac1a02631aaa05aa36416979316960c69d3f06.zip
FreeBSD-src-36ac1a02631aaa05aa36416979316960c69d3f06.tar.gz
Modify the kernel to use the new pr_usrreqs interface rather than the old
pr_usrreq mechanism which was poorly designed and error-prone. This commit renames pr_usrreq to pr_ousrreq so that old code which depended on it would break in an obvious manner. This commit also implements the new interface for TCP, although the old function is left as an example (#ifdef'ed out). This commit ALSO fixes a longstanding bug in the TCP timer processing (introduced by davidg on 1995/04/12) which caused timer processing on a TCB to always stop after a single timer had expired (because it misinterpreted the return value from tcp_usrreq() to indicate that the TCB had been deleted). Finally, some code related to polling has been deleted from if.c because it is not relevant t -current and doesn't look at all like my current code.
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index ce12fb8..bfcd1eb 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)if.c 8.3 (Berkeley) 1/4/94
- * $Id: if.c,v 1.31 1996/06/10 23:07:26 gpalmer Exp $
+ * $Id: if.c,v 1.32 1996/06/12 19:23:59 gpalmer Exp $
*/
#include <sys/param.h>
@@ -162,18 +162,6 @@ if_attach(ifp)
while (namelen != 0)
sdl->sdl_data[--namelen] = 0xff;
}
- /*
- * If they provided a slow input queue, initialize it.
- */
- if (ifp->if_poll_slowq) {
- struct ifqueue *ifq = ifp->if_poll_slowq;
-
- bzero(ifq, sizeof *ifq);
- ifq->ifq_maxlen = ifqmaxlen;
-#ifdef POLLING
- ifq->if_poll_recv = if_poll_recv_slow;
-#endif
- }
}
/*
* Locate an interface based on a complete address.
@@ -583,9 +571,9 @@ ifioctl(so, cmd, data, p)
if (so->so_proto == 0)
return (EOPNOTSUPP);
#ifndef COMPAT_43
- return ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
- (struct mbuf *)cmd, (struct mbuf *)data,
- (struct mbuf *)ifp));
+ return ((*so->so_proto->pr_usrreqs->pru_control)(so, cmd,
+ data,
+ ifp));
#else
{
int ocmd = cmd;
@@ -623,14 +611,10 @@ ifioctl(so, cmd, data, p)
case OSIOCGIFNETMASK:
cmd = SIOCGIFNETMASK;
}
- error = ((*so->so_proto->pr_usrreq)(so, PRU_CONTROL,
- /*
- * XXX callees reverse the following bogus casts,
- * but it would be easier to use a separate
- * interface that is guaranteed to work.
- */
- (struct mbuf *)cmd, (struct mbuf *)data,
- (struct mbuf *)ifp));
+ error = ((*so->so_proto->pr_usrreqs->pru_control)(so,
+ cmd,
+ data,
+ ifp));
switch (ocmd) {
case OSIOCGIFADDR:
@@ -759,3 +743,4 @@ ifconf(cmd, data)
}
SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
+SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
OpenPOWER on IntegriCloud