diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-20 17:12:35 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-20 17:12:35 +0200 |
commit | 80912664184e11c3b5637e6ca6af8478206b4528 (patch) | |
tree | 34f2a7df9722b6a9cdda1ac6df2dc00435dbe58b | |
parent | Merge pull request #4579 from opensourcerouting/mtype-fix (diff) | |
download | frr-80912664184e11c3b5637e6ca6af8478206b4528.tar.xz frr-80912664184e11c3b5637e6ca6af8478206b4528.zip |
bgpd: `neighbor X:X::X default-originate` complains about (null)
The `neighbor X:X::X default-originate command is complaining
that:
The route-map '(null)' does not exist.
Upon inspection of the code we were passing a NULL
string to the lookup. Testing for null gets us this:
donna.cumulusnetworks.com# conf t
donna.cumulusnetworks.com(config)# router bgp 99
donna.cumulusnetworks.com(config-router)# neighbor 2001:1::1:2 remote-as 99
donna.cumulusnetworks.com(config-router)# neighbor 2001:1::1:2 default-originate
donna.cumulusnetworks.com(config-router)# end
donna.cumulusnetworks.com# show run
Building configuration...
Current configuration:
!
frr version 7.2-dev
frr defaults datacenter
hostname donna.cumulusnetworks.com
log stdout
no ipv6 forwarding
!
ip route 4.5.6.7/32 10.50.11.4
!
router bgp 99
neighbor 2001:1::1:2 remote-as 99
!
address-family ipv4 unicast
neighbor 2001:1::1:2 default-originate
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | bgpd/bgp_vty.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 22e9469a7..091d8f031 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -4821,14 +4821,15 @@ static int peer_default_originate_set_vty(struct vty *vty, const char *peer_str, { int ret; struct peer *peer; - struct route_map *route_map; + struct route_map *route_map = NULL; peer = peer_and_group_lookup_vty(vty, peer_str); if (!peer) return CMD_WARNING_CONFIG_FAILED; if (set) { - route_map = route_map_lookup_warn_noexist(vty, rmap); + if (rmap) + route_map = route_map_lookup_warn_noexist(vty, rmap); ret = peer_default_originate_set(peer, afi, safi, rmap, route_map); } else |