summaryrefslogtreecommitdiffstats
path: root/zebra/zapi_msg.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-10-12bgpd: fix show bgp neighbor routes for labeled-unicastTrey Aspelund1-4/+4
bgp_show_neighbor_route() was rewriting safi from LU to uni before checking if the peer was enabled for LU. This resulted in the peer's address-family check looking for unicast, which would always fail for LU peers since unicast + LU are mutually-exclusive AFIs. This moves this safi reassignment after the peer AFI check, ensuring that the peer's address-family check looks for LU while the call to bgp_show() still uses uni. -- highlights from manual testing config: router bgp 2 neighbor 1.1.1.1 remote-as external neighbor 1.1.1.1 disable-connected-check neighbor 1.1.1.1 update-source 2.2.2.2 ! address-family ipv4 unicast no neighbor 1.1.1.1 activate exit-address-family ! address-family ipv4 labeled-unicast neighbor 1.1.1.1 activate exit-address-family before: spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes % No such neighbor or address family spine01# show bgp ipv4 labeled-unicast neighbors 1.1.1.1 routes % No such neighbor or address family after: spine01# show bgp ipv4 unicast neighbors 1.1.1.1 routes % No such neighbor or address family spine01# show bgp ipv4 label neighbors 1.1.1.1 routes BGP table version is 1, local router ID is 2.2.2.2 Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, i internal, r RIB-failure, S Stale, R Removed Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *> 11.11.11.11/32 1.1.1.1 0 0 1 i Displayed 1 routes and 1 total paths Signed-off-by: Trey Aspelund <taspelund@cumulusnetworks.com>
2020-10-12bgpd: Correctly calculate threshold being reachedDonald Sharp1-1/+2
if (pcout > (pcount * peer->max_threshold[afi][safi] / 100 )) is always true. So the very first route received will always trigger the warning. We actually want the warning to happen when we hit the threshold. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-11ospf6d, tests: Prevent use after freeDonald Sharp9-60/+69
The code pattern: for (ALL_LSDB(lsdb, lsa)) { remove_lsa(lsa) } has a use after free in ALL_LSDB, since we ask for the next pointer, after it has been freed. Modify the code such that we grab the next pointer before we can possibly free it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11ospf6d: Make ospf6_lsa_lock follow normal FRR patternDonald Sharp2-4/+4
The normal ospf6_lsa_lock call should return the pointer to the lock data structure we are holding. This is the normal pattern for locking a data structure in FRR. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11zebra: zevpn cannot be null passed into zebra_evpn_es_evi_show_one_evpnDonald Sharp1-0/+2
In zebra_evpn_es_evi_show_vni the zevpn pointer if passed into zebra_evpn_es_evi_show_one_evi will crash if it is null and we have code that checks that it is non null and then immediately calls the function. Add a return to prevent a crash. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-11zebra: n->mac is derefed in all pathsDonald Sharp1-3/+2
No need to check for n->mac existence as that all paths leading to this code have n->mac already derefed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-09staticd: To set the default value of blackhole type correctlyvdhingra1-0/+1
When nexthop is allocated, default value of blockhole type was not getting set, this leads to below problem. The default value should be in-sync with the deafult value in yang model. c t ip route 131.1.1.0/24 Null0 do show running-config ... ! ip route 131.1.1.0/24 blackhole ! end Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2020-10-09isisd: circuit->area->isis to circuit->isisDonald Sharp5-37/+32
The code in isisd uses `circuit->area->isis` all the time but we know that circuit now has a valid `circuit->isis` pointer so let's use that and cleanup the long dereference. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-09rip(ng)d: fix interfaces cleaningIgor Ryzhov2-2/+4
rip(ng)d_instance_disable unlinks the vrf from the instance which means that rip(ng)_interfaces_clean never works, because rip(ng)->vrf is always NULL there. This leads to the crash #6477. Clean interfaces before disabling the instance to fix the issue. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-09isisd: Always set `circuit->isis` on creationDonald Sharp3-9/+10
There are code paths where we were not always setting the circuit->isis on creation. Fix that up so it will always happen. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-09bgpd: Use default VRF name if using `router bgp` commandDonatas Abraitis1-1/+1
When we enter `router bgp` it enters non-VRF instance which is default. No need to check for VRF/VIEW name, kinda dead code. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-10-09doc: Fix pimd.rst warnings issued by sphinxDonald Sharp1-2/+2
A couple warnings have sneaked into the compilation of the pim documentation. Fix accordingly. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-10-09ospf6d: Move header includes around to reflect realityDonald Sharp5-5/+4
ospf6_network.h needs ospf6_top.h to be included first. This makes newer versions of gcc much much happier. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-10-08isisd: move debug variables under ifdefIgor Ryzhov1-2/+4
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-08isisd: check for circuit existence on interface addr changeIgor Ryzhov1-7/+14
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-08isisd: fix incorrect vrf lookupsIgor Ryzhov2-22/+10
Lookup in C_STATE_NA must be made before the new circuit creation, or it will be leaked if the isis instance is not found. All other lookups are unnecessary - we just need to remember the previously used instance. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-08isisd: add missing rollback if config is invalidIgor Ryzhov1-0/+1
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-10-08bgpd: re-use HELP_STR evpn macrosStephen Worley1-67/+67
Re-use some of the HELP_STR macros rather than copypastaing strings everywhere. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-10-08lib: add some EVPN help string constantsStephen Worley1-0/+11
Add some EVPN help string constants to make use of in later commits. Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-10-08tests: bgp_l3vpn_to_bgp_vrf test needed to correct orderQuentin Young1-8/+34
The bgp_l3vpn_to_bgp_vrf test is looking for a prefix on multiple routers that the ordered received is non-deterministic. As such the regex's are failing occassionaly when the route is received in an unexpected order. One possible order: (#89) scripts/check_routes.py:120 COMMAND:ce3:vtysh -c "show bgp ipv4 uni 6.0.1.0":2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3.* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight.* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1.* Origin IGP, metric 98, localpref 123, valid, internal.* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56:pass:Redundant route 1 details c: COMMAND OUTPUT:BGP routing table entry for 6.0.1.0/24^M Paths: (2 available, best #1, table default)^M Advertised to non peer-group peers:^M 192.168.1.1^M Local^M 99.0.0.3 from 0.0.0.0 (99.0.0.3)^M Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best (Weight)^M Community: 0:67^M Extended Community: RT:89:123^M Large Community: 12:34:56^M Last update: Wed Oct 7 11:12:22 2020^M Local^M 192.168.1.1 from 192.168.1.1 (192.168.1.1)^M Origin IGP, metric 98, localpref 123, valid, internal^M Community: 0:67^M Extended Community: RT:52:100 RT:89:123^M Large Community: 12:34:56^M Last update: Wed Oct 7 11:12:41 2020: R:89 ce3 Redundant route 1 details c 1 0 Second possible order: (#89) scripts/check_routes.py:120 COMMAND:ce3:vtysh -c "show bgp ipv4 uni 6.0.1.0":2 available, best .*192.168.1.1.* Local.* 99.0.0.3 from 0.0.0.0 .99.0.0.3.* Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best .Weight.* Community: 0:67.* Extended Community: RT:89:123.* Large Community: 12:34:56.* Local.* 192.168.1.1 from 192.168.1.1 .192.168.1.1.* Origin IGP, metric 98, localpref 123, valid, internal.* Community: 0:67.* Extended Community: RT:52:100 RT:89:123.* Large Community: 12:34:56:pass:Redundant route 1 details c: COMMAND OUTPUT:BGP routing table entry for 6.0.1.0/24^M Paths: (2 available, best #2, table default)^M Advertised to non peer-group peers:^M 192.168.1.1^M Local^M 192.168.1.1 from 192.168.1.1 (192.168.1.1)^M Origin IGP, metric 98, localpref 123, valid, internal^M Community: 0:67^M Extended Community: RT:52:100 RT:89:123^M Large Community: 12:34:56^M Last update: Wed Oct 7 11:14:45 2020^M Local^M 99.0.0.3 from 0.0.0.0 (99.0.0.3)^M Origin IGP, metric 200, localpref 50, weight 32768, valid, sourced, local, best (Weight)^M Community: 0:67^M Extended Community: RT:89:123^M Large Community: 12:34:56^M Last update: Wed Oct 7 11:14:27 2020: R:89 ce3 Redundant route 1 details c 0 1 BGP displays the paths in the order received since it's just a linked list. For this test modify/add the luCommands to track that we may receive the paths in a non-deterministic order. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-08doc: document use of black for python formattingQuentin Young1-5/+18
Also moves "Exceptions" for C code under the C subsection. Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-08bgpd: hide test commandsIgor Ryzhov1-2/+2
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>