From ec95e4c235c2f22c73d61d416fc7058ed062aa57 Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Fri, 6 Jun 2008 08:59:55 +0000 Subject: [PATCH] Don't abend if we get ENOMEM from sysctl(3). The data returned is sufficient MFC after: 2 weeks --- sbin/natd/natd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/natd/natd.c b/sbin/natd/natd.c index c0fb05facc9c..7a8d164ebcc2 100644 --- a/sbin/natd/natd.c +++ b/sbin/natd/natd.c @@ -884,7 +884,7 @@ SetAliasAddressFromIfName(const char *ifn) 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; /*