From owner-cvs-all Sat Jun 23 14:54:59 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 335FF37B416; Sat, 23 Jun 2001 14:54:48 -0700 (PDT) (envelope-from iedowse@FreeBSD.org) Received: (from iedowse@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5NLsmO69914; Sat, 23 Jun 2001 14:54:48 -0700 (PDT) (envelope-from iedowse) Message-Id: <200106232154.f5NLsmO69914@freefall.freebsd.org> From: Ian Dowse Date: Sat, 23 Jun 2001 14:54:48 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.sbin/rpcbind rpcb_svc_com.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG iedowse 2001/06/23 14:54:47 PDT Modified files: usr.sbin/rpcbind rpcb_svc_com.c Log: 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. Revision Changes Path 1.3 +22 -17 src/usr.sbin/rpcbind/rpcb_svc_com.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message