]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Prevent crash when issuing a show rpki connections
authorDonald Sharp <donaldsharp72@gmail.com>
Sat, 12 Apr 2025 20:56:30 +0000 (16:56 -0400)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Sun, 13 Apr 2025 03:27:53 +0000 (03:27 +0000)
When attempting to check rpki status and the connection
has been turned off, let's check to see if we are connected
before we ask the rpki subsystem, else we will get a crash
in the rpki library.

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
(cherry picked from commit dcf43ae009ffecf206fb8cf8896eb5cd616ba4e5)

bgpd/bgp_rpki.c

index 04a709b350e00af87e615e3795d64c2f2adb5e2b..aefb58094b276b0050f939a33417f61828623c75 100644 (file)
@@ -529,7 +529,10 @@ static struct rtr_mgr_group *get_groups(struct list *cache_list)
 
 inline bool is_synchronized(struct rpki_vrf *rpki_vrf)
 {
-       return rpki_vrf->rtr_is_synced;
+       if (is_running(rpki_vrf))
+               return rpki_vrf->rtr_is_synced;
+       else
+               return false;
 }
 
 inline bool is_running(struct rpki_vrf *rpki_vrf)