Use proper address family when adding multiple addresses to SQL pool
This commit is contained in:
@@ -495,6 +495,21 @@ static void add_addresses(char *pool, char *path, int timeout)
|
|||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (family == AF_INET6)
|
||||||
|
{ /* update address family if necessary */
|
||||||
|
addr = host_create_from_string("%any6", 0);
|
||||||
|
if (db->execute(db, NULL,
|
||||||
|
"UPDATE pools SET start = ?, end = ? WHERE id = ?",
|
||||||
|
DB_BLOB, addr->get_address(addr),
|
||||||
|
DB_BLOB, addr->get_address(addr), DB_UINT, pool_id) <= 0)
|
||||||
|
{
|
||||||
|
addr->destroy(addr);
|
||||||
|
fprintf(stderr, "updating pool address family failed.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
addr->destroy(addr);
|
||||||
|
}
|
||||||
|
|
||||||
commit_transaction();
|
commit_transaction();
|
||||||
|
|
||||||
printf("%d addresses done.\n", count);
|
printf("%d addresses done.\n", count);
|
||||||
|
|||||||
Reference in New Issue
Block a user