summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2020-11-17 08:33:59 +0200
committerGitHub <noreply@github.com>2020-11-17 08:33:59 +0200
commit81a8a58b99e9416ec970e1ba7c8a9b8a4ba68c11 (patch)
tree6b03408315eacb872b1ddee8196e3c728697a36d
parent0b75cd0bf3fa4093d0b5ac93f30bf8f656fb5edb (diff)
parent6d12b207033f90603a0a6642346c39aac17d1f9a (diff)
Merge pull request #7521 from donaldsharp/set_src_future_us
zebra: Allow `set src X` to work on startup
-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: