diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-01-11 01:25:02 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2000-01-11 01:25:02 +0000 |
commit | 8e69f01041c984d91992efac1a688e84049d5620 (patch) | |
tree | 2fc8671fca6e898a03ab09ff0067dbe138b8e3d0 | |
parent | 89f65fe490684b6564d9e6237c7935be52959692 (diff) |
Remove references to ipx_error.h. Insert the pcb at splnet.
-rw-r--r-- | sys/netipx/ipx_pcb.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c index 0b55f91fa28..dfebd7c0779 100644 --- a/sys/netipx/ipx_pcb.c +++ b/sys/netipx/ipx_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipx_pcb.c,v 1.3 1999/04/28 09:28:16 art Exp $ */ +/* $OpenBSD: ipx_pcb.c,v 1.4 2000/01/11 01:25:01 fgsch Exp $ */ /*- * @@ -59,16 +59,17 @@ struct ipx_addr zeroipx_addr; #define IPXPCBHASH(table, faddr, fport, laddr, lport) \ - &(table)->ipxpt_hashtbl[(ntohl((faddr)->ipx_net.l_net) \ - + ntohs((fport)) \ - + ntohs((lport))) & (table->ipxpt_hash)] + &(table)->ipxpt_hashtbl[(ntohl((faddr)->ipx_net.l_net) + \ + ntohs((fport)) + ntohs((lport))) & (table->ipxpt_hash)] + void ipx_pcbinit(table, hashsize) - struct ipxpcbtable *table; - int hashsize; + struct ipxpcbtable *table; + int hashsize; { CIRCLEQ_INIT(&table->ipxpt_queue); - table->ipxpt_hashtbl = hashinit(hashsize, M_PCB, M_WAITOK, &table->ipxpt_hash); + table->ipxpt_hashtbl = + hashinit(hashsize, M_PCB, M_WAITOK, &table->ipxpt_hash); table->ipxpt_lport = 0; } @@ -78,6 +79,7 @@ ipx_pcballoc(so, head) struct ipxpcbtable *head; { register struct ipxpcb *ipxp; + int s; ipxp = malloc(sizeof(*ipxp), M_PCB, M_DONTWAIT); if (ipxp == NULL) @@ -85,9 +87,11 @@ ipx_pcballoc(so, head) bzero((caddr_t)ipxp, sizeof(*ipxp)); ipxp->ipxp_socket = so; ipxp->ipxp_table = head; + s = splnet(); CIRCLEQ_INSERT_HEAD(&head->ipxpt_queue, ipxp, ipxp_queue); LIST_INSERT_HEAD(IPXPCBHASH(head, &ipxp->ipxp_faddr, ipxp->ipxp_fport, &ipxp->ipxp_laddr, ipxp->ipxp_lport), ipxp, ipxp_hash); + splx(s); so->so_pcb = (caddr_t)ipxp; return (0); } |