Don't abend if we get ENOMEM from sysctl(3). The data returned

is sufficient

MFC after:	2 weeks
This commit is contained in:
Brian Somers 2008-06-06 08:59:55 +00:00
parent 3595f21aae
commit ec95e4c235
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179607

View File

@ -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;
/*