]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix some return-value brain-damage in forward_register(). This
authoriedowse <iedowse@FreeBSD.org>
Sat, 23 Jun 2001 21:54:47 +0000 (21:54 +0000)
committeriedowse <iedowse@FreeBSD.org>
Sat, 23 Jun 2001 21:54:47 +0000 (21:54 +0000)
commitde405c7145120145d628122751a0ed2030f722ef
tree0b594fc34512be640ff7bb03db263448b340e04c
parent5ad8ec82779efbd25afbdaef579349c343a9da04
Fix some return-value brain-damage in forward_register(). This
function has a return type of u_int32_t, into which it was somehow
supposed to encode:
 *  A valid 32-bit XID (which could be any value including 0).
 *  0, meaning a duplicate request.
 *  -1, meaning a malloc failed (!);
We now ensure that all XIDs are non-zero, and pass the XID out via
a pointer argument.

In forward_find() and free_slot_by_xid(), remove an unnecessary
and confusing test for a negative result from an unsigned modulo
operation, but add an unnecessary cast to highlight why.
usr.sbin/rpcbind/rpcb_svc_com.c