summaryrefslogtreecommitdiff
path: root/zebra/zebra_nb_config.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2020-11-13 12:06:57 -0500
committerDonald Sharp <sharpd@nvidia.com>2020-11-13 16:12:26 -0500
commit6d12b207033f90603a0a6642346c39aac17d1f9a (patch)
tree35cc73016c011fce69827aa44cb676ddc3c7e02e /zebra/zebra_nb_config.c
parent15675d025dc024733a532e1a9ad19c59df4ba73d (diff)
zebra: Allow `set src X` to work on startup
If a route-map in zebra has `set src X` and the interface X is on has not been configured yet, we are rejecting the command outright. This is a problem on boot up especially( and where I found this issue ) in that interfaces *can* and *will* be slow on startup and config can easily be read in *before* the interface has an ip address. Let's modify zebra to just warn to the user we may have a problem and let the chips fall where they may. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'zebra/zebra_nb_config.c')
-rw-r--r--zebra/zebra_nb_config.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/zebra/zebra_nb_config.c b/zebra/zebra_nb_config.c
index df95770307..ea2e20ed3b 100644
--- a/zebra/zebra_nb_config.c
+++ b/zebra/zebra_nb_config.c
@@ -1550,12 +1550,14 @@ int lib_route_map_entry_set_action_source_v4_modify(
if (pif != NULL)
break;
}
- if (pif == NULL) {
- snprintf(args->errmsg, args->errmsg_len,
- "is not a local address: %s",
- yang_dnode_get_string(args->dnode, NULL));
- return NB_ERR_VALIDATION;
- }
+ /*
+ * On startup the local address *may* not have come up
+ * yet. We need to allow startup configuration of
+ * set src or we are fudged. Log it for future fun
+ */
+ if (pif == NULL)
+ zlog_warn("set src %pI4 is not a local address",
+ &p.u.prefix4);
return NB_OK;
case NB_EV_PREPARE:
case NB_EV_ABORT:
@@ -1618,12 +1620,14 @@ int lib_route_map_entry_set_action_source_v6_modify(
if (pif != NULL)
break;
}
- if (pif == NULL) {
- snprintf(args->errmsg, args->errmsg_len,
- "is not a local adddress: %s",
- yang_dnode_get_string(args->dnode, NULL));
- return NB_ERR_VALIDATION;
- }
+ /*
+ * On startup the local address *may* not have come up
+ * yet. We need to allow startup configuration of
+ * set src or we are fudged. Log it for future fun
+ */
+ if (pif == NULL)
+ zlog_warn("set src %pI6 is not a local address",
+ &p.u.prefix6);
return NB_OK;
case NB_EV_PREPARE:
case NB_EV_ABORT: