mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 03:53:38 +00:00
zebra: Do not send a router-id of 0.0.0.0 when we don't know it yet
At startup there exists a time frame where we might not know a particular vrf's router id. When zebra gets a request for it let's not just blindly send whatever we have. Let's be a bit smart and only respond with one if we have one. The upper level protocol can wait for it to have one. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
2ca7780ab5
commit
0114135890
@ -2221,8 +2221,8 @@ stream_failure:
|
|||||||
static void zread_router_id_add(ZAPI_HANDLER_ARGS)
|
static void zread_router_id_add(ZAPI_HANDLER_ARGS)
|
||||||
{
|
{
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
|
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
|
struct prefix zero;
|
||||||
|
|
||||||
STREAM_GETW(msg, afi);
|
STREAM_GETW(msg, afi);
|
||||||
|
|
||||||
@ -2238,6 +2238,18 @@ static void zread_router_id_add(ZAPI_HANDLER_ARGS)
|
|||||||
|
|
||||||
router_id_get(afi, &p, zvrf);
|
router_id_get(afi, &p, zvrf);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we have not officially setup a router-id let's not
|
||||||
|
* tell the upper level protocol about it yet.
|
||||||
|
*/
|
||||||
|
memset(&zero, 0, sizeof(zero));
|
||||||
|
if ((p.family == AF_INET && p.u.prefix4.s_addr == INADDR_ANY)
|
||||||
|
|| (p.family == AF_INET6
|
||||||
|
&& memcmp(&p.u.prefix6, &zero.u.prefix6,
|
||||||
|
sizeof(struct in6_addr))
|
||||||
|
== 0))
|
||||||
|
return;
|
||||||
|
|
||||||
zsend_router_id_update(client, afi, &p, zvrf_id(zvrf));
|
zsend_router_id_update(client, afi, &p, zvrf_id(zvrf));
|
||||||
|
|
||||||
stream_failure:
|
stream_failure:
|
||||||
|
Loading…
Reference in New Issue
Block a user