mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 07:48:07 +00:00
bgpd: Allow failed hostname lookup to continue in bmp
Add a bit of code to allow hostname lookup failure to not stall bmp communication. Fixes: #5382 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e302caaa81
commit
a3d04c32b8
@ -1669,11 +1669,18 @@ static void bmp_active_resolved(struct resolver_query *resq, int numaddrs,
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
if (numaddrs <= 0) {
|
if (numaddrs <= 0) {
|
||||||
zlog_warn("bmp[%s]: hostname resolution failed", ba->hostname);
|
int ret;
|
||||||
|
|
||||||
|
ba->addrpos = 0;
|
||||||
|
ba->addrtotal = 1;
|
||||||
|
ret = str2sockunion(ba->hostname, &ba->addrs[0]);
|
||||||
|
if (ret < 0) {
|
||||||
|
ba->addrtotal = 0;
|
||||||
ba->curretry += ba->curretry / 2;
|
ba->curretry += ba->curretry / 2;
|
||||||
bmp_active_setup(ba);
|
bmp_active_setup(ba);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if (numaddrs > (int)array_size(ba->addrs))
|
if (numaddrs > (int)array_size(ba->addrs))
|
||||||
numaddrs = array_size(ba->addrs);
|
numaddrs = array_size(ba->addrs);
|
||||||
|
|
||||||
@ -1681,6 +1688,7 @@ static void bmp_active_resolved(struct resolver_query *resq, int numaddrs,
|
|||||||
ba->addrtotal = numaddrs;
|
ba->addrtotal = numaddrs;
|
||||||
for (i = 0; i < ba->addrtotal; i++)
|
for (i = 0; i < ba->addrtotal; i++)
|
||||||
memcpy(&ba->addrs[i], &addr[i], sizeof(ba->addrs[0]));
|
memcpy(&ba->addrs[i], &addr[i], sizeof(ba->addrs[0]));
|
||||||
|
}
|
||||||
|
|
||||||
bmp_active_connect(ba);
|
bmp_active_connect(ba);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user