From owner-cvs-all Sun Jun 24 8: 3:12 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 92FED37B405; Sun, 24 Jun 2001 08:03:07 -0700 (PDT) (envelope-from iedowse@FreeBSD.org) Received: (from iedowse@localhost) by freefall.freebsd.org (8.11.3/8.11.3) id f5OF37t25698; Sun, 24 Jun 2001 08:03:07 -0700 (PDT) (envelope-from iedowse) Message-Id: <200106241503.f5OF37t25698@freefall.freebsd.org> From: Ian Dowse Date: Sun, 24 Jun 2001 08:03:07 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.sbin/rpcbind util.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/24 08:03:07 PDT Modified files: usr.sbin/rpcbind util.c Log: Clean up the addrmerge() function, which was over-complicated and contained a number of memory leaks. The changes include: - Add a comment describing what addrmerge() does. - Deal with 0.0.0.0./::. or AF_LOCAL callers correctly. - Use rpcbind_get_conf() instead of getnetconfigent() so we don't have to remember to free the returned netconfig struct. - Make just one pass through the ifaddrs list; we can pick up a fallback interface address in the same pass as the netmask comparison. - Define and use SA2SIN* macros to avoid the need for loads of protocol-specific local variables. - Use mostly protocol-independent code for building the netbuf version of the address to be returned. - Use the common cleanup code for virtually all error and non-error cases, fixing a number of memory leaks. Revision Changes Path 1.3 +121 -137 src/usr.sbin/rpcbind/util.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message