diff options
| -rw-r--r-- | zebra/router-id.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/zebra/router-id.c b/zebra/router-id.c index 689b9787ee..ac81d537d0 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -120,10 +120,12 @@ int router_id_get(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf) static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf) { - struct prefix p2; + struct prefix after, before; struct listnode *node; struct zserv *client; + router_id_get(afi, &before, zvrf); + switch (afi) { case AFI_IP: zvrf->rid_user_assigned.u.prefix4.s_addr = p->u.prefix4.s_addr; @@ -135,10 +137,17 @@ static int router_id_set(afi_t afi, struct prefix *p, struct zebra_vrf *zvrf) return -1; } - router_id_get(afi, &p2, zvrf); + router_id_get(afi, &after, zvrf); + + /* + * If we've been told that the router-id is exactly the same + * do we need to really do anything here? + */ + if (prefix_same(&before, &after)) + return 0; for (ALL_LIST_ELEMENTS_RO(zrouter.client_list, node, client)) - zsend_router_id_update(client, afi, &p2, zvrf->vrf->vrf_id); + zsend_router_id_update(client, afi, &after, zvrf->vrf->vrf_id); return 0; } |
