doc: Fix typo "echo interval" -> "each interval"This typo was introduced back in commit 4db5d90acf047bb67969037c3744793765e90118
Signed-off-by: Paul Tobias <tobias.pal@gmail.com>
bgpd: fix refcounts at terminationClean up an issue with refcounts in bgpd. Ensure that a
bgp instance that's being deleted unrefs if its "clearing"
event was scheduled: that event holds an extra ref.
Signed-off-by: Mark Stapp <mjs@cisco.com>
tests: test for notify callback on NP container bugHave client attach it's notify handler to the topmost container which is
non-presence. This is presumed to be a very common use case, it also exposes the
bug we are fixing.
Also we don't rely on protobuf anymore so get rid of that test in the topotest
while we are here.
Signed-off-by: Christian Hopps <chopps@labn.net>
lib: allow attaching notify handler to covering NP containersPreviously attaching a notify handler to a covering container that was
non-presence would not be noticed due to an apparent optimization in the nb_node
parent chain which skips over NP container nodes in branches. Use the libyang
parent pointer chain to avoid this problem.
Signed-off-by: Christian Hopps <chopps@labn.net>
tests: adjust topotests post the change for peer down cause with ceaseWith the fix for the peer down cause in sending a cease notification,
we can now differentiate whether a peer down is locally initiated or
is due to a received cease. For a locally initiated cease, the peer
down cause is shown directly. For a peer down due to a received cease,
the notification subcode is shown.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
bgpd: record the peer down cause when sending cease notificationCurrently the peer down cause is recorded only for a susbset of
cease subcodes when sending a notifications. In particular the
subcode PEER_DOWN_PFX_COUNT is not recorded.
The fix is to record the peeer down cause for all cease subcodes
when sending a cease notification.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
bgpd: set last_reset for the nht change only in specific casesWhen a nht becomes unresolved, a peer being tracked by the nht is
brought down only under certain specific conditions. Record the
last_reset accordingly.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
tests: fix several topotests for bgp GR in topo1-4.py and topo2-3.pyFix several topotests for bgp gr: test_BGP_GR_TC_49_p1 and
test_BGP_GR_TC_53_p1 in topo1-4.py, and test_BGP_GR_15_p2 in
topo2-3.py.
The "preserve-fw-state" needs to be set on R1 in order for R2 to
retain the routes from R1 when R1 restarts.
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
lib: Return a valid JSON if prefix-list is not foundBefore it was:
{
"zebra":,"bgpd":
}
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd: don't use stale 'evpn' pointer in bgp_update()The pointer 'evpn' in bgp_update() can be stale after creating/
interning attrs into attr_new; use the value from the new attr
object.
Signed-off-by: Mark Stapp <mjs@cisco.com>
bgpd: remove the last_reset copying in peer_xfer_conn()Just like the "established" or "dropped" counters for a peer, the
last_reset field should not be copied in peer_xfer_conn().
Signed-off-by: Enke Chen <enchen@paloaltonetworks.com>
doc: Update typesafe hash to talk about memory usageThe typesafe hash's auto-grow and auto-shrink which
causes memory allocations and memmoves. This can
be expensive.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Allow for NOS to initialize some zrouter valuesCurrently it is up to the operator to fully specify zrouter values
via command line or compile time options. It is desirable to allow
a copy of FRR to dynamically figure some of these out at run time.
Let's provide a hook for that too happen.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra: Abstract architectural values that may change based upon NOSThere is a set of values stored in zebra_router that are really
architectural values that may or may not change based upon the
underlying NOS being run. Let's move them out of zebra_router
and into their own structure such that when we want to expose
these values they do not expose all of the zebra_router internals.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
lib: improve handling of prefix-list in route-mapAdd a NULL check before dereferencing a prefix-list struct
in routemap code.
Signed-off-by: Mark Stapp <mjs@cisco.com>
topotests: bgp_srv6l3vpn_to_bgp_vrf3, remove vpn entriesWhen removing the srv6 locator, the vpn entries are unselected, and are
no more exported to vpn network.
The case where bgp has its locator unconfigured leads to maintaining vpn
entries, but without srv6.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
topotests: bgp_srv6l3vpn_to_bgp_vrf, remove vpn entriesModify test, because upon locator deletion, VPN entries are flushed.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
topotests: bgp_srv6l3vpn_sid, remove vpn entriesWhen disabling srv6, the vpn entries are unselected, and are no more
exported to vpn network. Update r1 and r2 RIB entries when locator is
suppressed from BGP configuration.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix do not export bgp updates when sid exportation failsThe below configuration without any configured locator exports BGP
VPN updates with label set to implicit-null.
> router bgp 65500 vrf vrf20
> address-family ipv6 unicast
> sid vpn export auto
> rd vpn export 1:20
> rt vpn both 88:88
> export vpn
> import vpn
This case should happen only if SRv6 exportation is not configured.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind...
bgpd: fix sids not removed when locator info is deletedWhen locator is removed from the srv6 zebra configuration, BGP VPN
entries are unselected, but still keep the old SID information.
Fix this by flushing the related VPN entries.
Also simplify the code by using a single loop to modify both locators
and sids.
Call the vpn_leak_postchange_all() function in the end.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: fix sids not removed when changing locatorWhen removing a locator, the SID is not released from the srv6 SID
manager:
> r1(config-router-srv6)# do show segment-routing srv6 sid
> SID Behavior Context Daemon/Instance Locator AllocationType
> ---------------------------- ------------- ----------------- --------- ----------------
> 2001:db8:1:1:1:: End.DT4 VRF 'vrf10' bgp(0) loc1 ...
bgpd: add comment to inform default l3vpn sid entries are ignoredThe current code has some limitations when supporting SID entries in the
default VRF instance. Add a comment to explain the reason.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
tests: check zebra ipv4 table for ldp neighborAdd two cases for r1 and r2: ( Corresponding to the first two commits )
1) After ldp neighbor removed, route should be without label.
2) With both targeted and link configuration, route should be with label.
Signed-off-by: anlan_cs <anlan_cs@126.com>
ldpd: fix no sending klabels to zebraTwo directly connected boxes: establish a targeted connection with loopback
interface between them, and then add ldp interface.
( NOTE: The reverse order is fine. )
```
anlan(config)# mpls ldp
anlan(config-ldp)# address-family ipv4
anlan(config-ldp-af)# neighbor 1.1.1.1 targeted
anlan(config-ldp-af)# int enp1s0
```
The issue is that route to "1.1.1.1" is without label.
When the targeted connec...
ldpd: fix no releasing klabels to zebraThis problem only involves link connection, and has nothing to do with
targeted connection.
```
anlan(config)# mpls ldp
anlan(config-ldp)# address-family ipv4
anlan(config-ldp-af)# int enp1s0
anlan(config-ldp-af)# no int enp1s0 <- not release the route with klabel from zebra
```
Signed-off-by: anlan_cs <anlan_cs@126.com>