summaryrefslogtreecommitdiff
path: root/lib/vrf.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2020-05-14 21:34:12 -0300
committerRenato Westphal <renato@opensourcerouting.org>2020-05-28 19:22:54 -0300
commit10bdc68f0c13e064dc487b4fdafc7d9124d9d697 (patch)
tree40bf68beb7696ac4eef3dd7172419e1f55d15e6a /lib/vrf.c
parentdf5eda3d8783a3436f43821a2840911d610fd89d (diff)
*: convert northbound callbacks to new error handling model
The northbound configuration callbacks should now print error messages to the provided buffer (args->errmsg) instead of logging them directly. This will allow the northbound layer to forward the error messages to the northbound clients in addition to logging them. NOTE: many callbacks are returning errors without providing any error message. This needs to be fixed long term. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/vrf.c')
-rw-r--r--lib/vrf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index 9df5d19516..fb64589287 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -1082,8 +1082,8 @@ static int lib_vrf_destroy(struct nb_cb_destroy_args *args)
case NB_EV_VALIDATE:
vrfp = nb_running_get_entry(args->dnode, NULL, true);
if (CHECK_FLAG(vrfp->status, VRF_ACTIVE)) {
- zlog_debug("%s Only inactive VRFs can be deleted",
- __func__);
+ snprintf(args->errmsg, args->errmsg_len,
+ "Only inactive VRFs can be deleted");
return NB_ERR_VALIDATION;
}
break;