summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx_pcb.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-12-30 17:54:53 +0000
committerrwatson <rwatson@FreeBSD.org>2004-12-30 17:54:53 +0000
commita163a92e00dddb1f523138f73886e451ae06b29e (patch)
treef1dbc2ee53a82695fe514cdabda594b6a61b04ab /sys/netipx/ipx_pcb.c
parent767b9c0b3efe618078d08c4cf137ab912f502ca2 (diff)
downloadFreeBSD-src-a163a92e00dddb1f523138f73886e451ae06b29e.zip
FreeBSD-src-a163a92e00dddb1f523138f73886e451ae06b29e.tar.gz
Use a global variable, ipxpcb_lport_cache, to cache the most recently
used IPX port number, rather than using the global ipxpcb list head.
Diffstat (limited to 'sys/netipx/ipx_pcb.c')
-rw-r--r--sys/netipx/ipx_pcb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netipx/ipx_pcb.c b/sys/netipx/ipx_pcb.c
index 6cb8e50..aa7527a 100644
--- a/sys/netipx/ipx_pcb.c
+++ b/sys/netipx/ipx_pcb.c
@@ -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);
OpenPOWER on IntegriCloud