Return zero from get_addrselectpolicy() when no source-address-selection
policy is installed. MFC after: 1 week
This commit is contained in:
parent
e69c4af4ad
commit
c9ba4f7b25
@ -692,6 +692,8 @@ get_addrselectpolicy(struct policyhead *head)
|
||||
|
||||
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &l, NULL, 0) < 0)
|
||||
return (0);
|
||||
if (l == 0)
|
||||
return (0);
|
||||
if ((buf = malloc(l)) == NULL)
|
||||
return (0);
|
||||
if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &l, NULL, 0) < 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user