diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-04-21 08:04:06 -0400 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-04-21 08:04:06 -0400 |
| commit | 332133d19becb6d4e48d730cf47de017f0a4b4f5 (patch) | |
| tree | 14c68d19a9df636fddbffc0fccd7d7f7d23811d2 /bgpd/bgp_evpn_vty.c | |
| parent | bc479b1b17b3f12b487f4164966b35d1ec08fede (diff) | |
bgpd: Ensure bgp_vrf is non-null
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>
Diffstat (limited to 'bgpd/bgp_evpn_vty.c')
| -rw-r--r-- | bgpd/bgp_evpn_vty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index c1bcbf77ce..811856bfed 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -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; |
