From 0030482f5ecdbab54ee607908b70ce3022728380 Mon Sep 17 00:00:00 2001 From: Rafael Zalamena Date: Wed, 29 May 2019 17:17:37 -0300 Subject: [PATCH] bfdd: fix northbound remote-discriminator display When the remote discriminator hasn't been assigned yet, then we can't return a value of 0. The value '0' is an invalid discriminator and the yang handlers will complain about it. Signed-off-by: Rafael Zalamena --- bfdd/bfdd_northbound.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bfdd/bfdd_northbound.c b/bfdd/bfdd_northbound.c index bbc39fc9c4..4b21a21162 100644 --- a/bfdd/bfdd_northbound.c +++ b/bfdd/bfdd_northbound.c @@ -546,6 +546,9 @@ bfdd_bfd_sessions_single_hop_stats_remote_discriminator_get_elem( { const struct bfd_session *bs = list_entry; + if (bs->discrs.remote_discr == 0) + return NULL; + return yang_data_new_uint32(xpath, bs->discrs.remote_discr); }