mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
bgpd: Fix standalone to better handle getsockopt failure
When getsockopt(...,SO_BINDTODEVICE,...); fails assume the bgp instance we are interested is the default one. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
1bce440338
commit
bc06d287d1
@ -257,13 +257,14 @@ bgp_get_instance_for_inc_conn (int sock, struct bgp **bgp_inst)
|
|||||||
zlog_err ("[Error] BGP SO_BINDTODEVICE get failed (%s), sock %d",
|
zlog_err ("[Error] BGP SO_BINDTODEVICE get failed (%s), sock %d",
|
||||||
safe_strerror (errno), sock);
|
safe_strerror (errno), sock);
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
|
||||||
strcpy (name, VRF_DEFAULT_NAME);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strlen(name))
|
if (!strlen(name))
|
||||||
return 0; /* default instance. */
|
{
|
||||||
|
*bgp_inst = bgp_get_default ();
|
||||||
|
return 0; /* default instance. */
|
||||||
|
}
|
||||||
|
|
||||||
/* First try match to instance; if that fails, check for interfaces. */
|
/* First try match to instance; if that fails, check for interfaces. */
|
||||||
bgp = bgp_lookup_by_name (name);
|
bgp = bgp_lookup_by_name (name);
|
||||||
|
Loading…
Reference in New Issue
Block a user