Use a global variable, ipxpcb_lport_cache, to cache the most recently
used IPX port number, rather than using the global ipxpcb list head.
This commit is contained in:
parent
767b9c0b3e
commit
a163a92e00
@ -88,6 +88,7 @@ struct sockaddr_ipx ipx_netmask, ipx_hostmask;
|
||||
/*
|
||||
* IPX protocol control block (pcb) lists.
|
||||
*/
|
||||
u_short ipxpcb_lport_cache;
|
||||
struct ipxpcbhead ipxpcb_list;
|
||||
struct ipxpcbhead ipxrawpcb_list;
|
||||
|
||||
|
@ -110,11 +110,11 @@ ipx_pcbbind(ipxp, nam, td)
|
||||
noname:
|
||||
if (lport == 0)
|
||||
do {
|
||||
ipxpcb.ipxp_lport++;
|
||||
if ((ipxpcb.ipxp_lport < IPXPORT_RESERVED) ||
|
||||
(ipxpcb.ipxp_lport >= IPXPORT_WELLKNOWN))
|
||||
ipxpcb.ipxp_lport = IPXPORT_RESERVED;
|
||||
lport = htons(ipxpcb.ipxp_lport);
|
||||
ipxpcb_lport_cache++;
|
||||
if ((ipxpcb_lport_cache < IPXPORT_RESERVED) ||
|
||||
(ipxpcb_lport_cache >= IPXPORT_WELLKNOWN))
|
||||
ipxpcb_lport_cache = IPXPORT_RESERVED;
|
||||
lport = htons(ipxpcb_lport_cache);
|
||||
} while (ipx_pcblookup(&zeroipx_addr, lport, 0));
|
||||
ipxp->ipxp_lport = lport;
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user