]> git.puffer.fish Git - mirror/frr.git/commit
bgpd: fix NULL dereference in vrf-vpn leak config if before default instance 2591/head
authorG. Paul Ziemba <paulz@labn.net>
Fri, 29 Jun 2018 21:55:59 +0000 (14:55 -0700)
committerG. Paul Ziemba <paulz@labn.net>
Sat, 30 Jun 2018 17:09:23 +0000 (10:09 -0700)
commit3bd70bf8f37bd899b82534d71572714404eb94c9
treed625b20e9e85ae505ffb618227ff18d2b89c3435
parentc3555a6d1231948d148df2135c3f69934de16e77
bgpd: fix NULL dereference in vrf-vpn leak config if before default instance

Issue 2473

VRF-VPN route-leaking configuration commands assumed existence of
default bgp instance. If a non-default vrf configuration occurred
before the default vrf configuration, it would result in a (NULL)
dereference to the non-existent default vrf.

This change 1) detects non-existence of default vrf and skips corresponding
RIB updating that normally occurs during configuration changes of the
route-leaking parameters; and 2) when the default bgp instance is defined,
runs the deferred RIB updating.

In vpn_leak_to_vrf_update_all(), replace early return if bgp_vpn is NULL
with assert, as the former would lead to subtly wrong RIB contents. The
underlying issue that led to commit 73aed5841a1fe31e8a1f251dfcf87e1f2b1f2463
should be fixed by the above changes.

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
bgpd/bgp_mplsvpn.c
bgpd/bgp_mplsvpn.h
bgpd/bgp_vty.c