svn commit: r215842 - stable/7/sbin/natd

Brian Somers brian at FreeBSD.org
Thu Nov 25 21:42:37 UTC 2010


Author: brian
Date: Thu Nov 25 21:42:36 2010
New Revision: 215842
URL: http://svn.freebsd.org/changeset/base/215842

Log:
  MF8: Don't abend if we get ENOMEM from sysctl(3).  The data returned
       is sufficient

Modified:
  stable/7/sbin/natd/natd.c
Directory Properties:
  stable/7/sbin/natd/   (props changed)

Modified: stable/7/sbin/natd/natd.c
==============================================================================
--- stable/7/sbin/natd/natd.c	Thu Nov 25 20:35:49 2010	(r215841)
+++ stable/7/sbin/natd/natd.c	Thu Nov 25 21:42:36 2010	(r215842)
@@ -885,7 +885,7 @@ SetAliasAddressFromIfName(const char *if
 		err(1, "iflist-sysctl-estimate");
 	if ((buf = malloc(needed)) == NULL)
 		errx(1, "malloc failed");
-	if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1)
+	if (sysctl(mib, 6, buf, &needed, NULL, 0) == -1 && errno != ENOMEM)
 		err(1, "iflist-sysctl-get");
 	lim = buf + needed;
 /*


More information about the svn-src-stable-7 mailing list