]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Ensure bgp_vrf is non-null
authorDonald Sharp <sharpd@nvidia.com>
Fri, 21 Apr 2023 12:04:06 +0000 (08:04 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 21 Apr 2023 12:04:06 +0000 (08:04 -0400)
If we attempt to get the bgp_vrf and it fails then
ensure that we don't just de-ref and crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_evpn_vty.c

index c1bcbf77ce7554257118d3c46345b7ef77fe5ab6..811856bfed6a08a9a5599588d75ffcbaed194bb5 100644 (file)
@@ -4305,7 +4305,7 @@ DEFPY (bgp_evpn_advertise_pip_ip_mac,
        struct bgp *bgp_vrf = VTY_GET_CONTEXT(bgp); /* bgp vrf instance */
        struct bgp *bgp_evpn = NULL;
 
-       if (EVPN_ENABLED(bgp_vrf)) {
+       if (!bgp_vrf || EVPN_ENABLED(bgp_vrf)) {
                vty_out(vty,
                        "This command is supported under L3VNI BGP EVPN VRF\n");
                return CMD_WARNING_CONFIG_FAILED;