diff options
| author | Karen Schoener <karen@voltanet.io> | 2021-06-17 09:26:36 -0400 |
|---|---|---|
| committer | Karen Schoener <karen@voltanet.io> | 2021-06-28 10:32:52 -0400 |
| commit | 0b4124c18cb826849f18af58dbc712db7d14b993 (patch) | |
| tree | 28ff0015d6f7f93ebc5585ca867686a4513a20c9 /lib/zclient.c | |
| parent | 0e5572bc63f93c19ceb296f12b458fc728770f0e (diff) | |
isisd, ospfd: update interface_link_params callback to check for change
Adding defensive code to the interface_link_params zebra callback
to check if the link params changed before taking action.
Signed-off-by: Karen Schoener <karen@voltanet.io>
Diffstat (limited to 'lib/zclient.c')
| -rw-r--r-- | lib/zclient.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index 4a70881b57..ffae1332af 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -2269,10 +2269,13 @@ stream_failure: } struct interface *zebra_interface_link_params_read(struct stream *s, - vrf_id_t vrf_id) + vrf_id_t vrf_id, + bool *changed) { struct if_link_params *iflp; + struct if_link_params iflp_copy; ifindex_t ifindex; + bool params_changed = false; STREAM_GETL(s, ifindex); @@ -2285,12 +2288,23 @@ struct interface *zebra_interface_link_params_read(struct stream *s, return NULL; } + if (ifp->link_params == NULL) + params_changed = true; + if ((iflp = if_link_params_get(ifp)) == NULL) return NULL; + memcpy(&iflp_copy, iflp, sizeof(iflp_copy)); + if (link_params_set_value(s, iflp) != 0) goto stream_failure; + if (memcmp(&iflp_copy, iflp, sizeof(iflp_copy))) + params_changed = true; + + if (changed) + *changed = params_changed; + return ifp; stream_failure: |
