Commit Graph

1176 Commits

Author SHA1 Message Date
Donald Sharp
d588b995f9 bgpd: use appropriate printf formatter for some uint32_t
newm and existm are uint32_t so let's use %u instead of %d
to print them out.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-15 10:56:08 -04:00
Donald Sharp
c0d72166ee bgpd: Convert remaining string output to our internal types
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-09 19:50:42 -05:00
Donald Sharp
b5b99af853 bgpd: Display RPKI validation state if we have it
When dumping data about prefixes in bgp.  Let's dump the
rpki validation state as well:

Output if rpki is turned on:
janelle# show rpki prefix 2003::/19
Prefix                                   Prefix Length  Origin-AS
2003::                                      19 -  19         3320
janelle# show bgp ipv6 uni 2003::/19
BGP routing table entry for 2003::/19
Paths: (1 available, best #1, table default)
  Not advertised to any peer
  15096 6939 3320
    ::ffff:4113:867a from 65.19.134.122 (193.72.216.231)
    (fe80::e063:daff:fe79:1dab) (used)
      Origin IGP, valid, external, best (First path received), validation-state: valid
      Last update: Sat Mar  6 09:20:51 2021
janelle# show rpki prefix 8.8.8.0/24
Prefix                                   Prefix Length  Origin-AS
janelle# show bgp ipv4 uni 8.8.8.0/24
BGP routing table entry for 8.8.8.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  100.99.229.142
  15096 6939 15169
    65.19.134.122 from 65.19.134.122 (193.72.216.231)
      Origin IGP, valid, external, best (First path received), validation-state: not found
      Last update: Sat Mar  6 09:21:25 2021

Example output when rpki is not configured:
eva# show bgp ipv4 uni 8.8.8.0/24
BGP routing table entry for 8.8.8.0/24
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  janelle(192.168.161.137)
  64539 15096 6939 15169
    192.168.161.137(janelle) from janelle(192.168.161.137) (192.168.44.1)
      Origin IGP, valid, external, bestpath-from-AS 64539, best (First path received)
      Last update: Sat Mar  6 09:33:51 2021

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-07 07:08:33 -05:00
Trey Aspelund
3ba7b4aff0 bgpd: fix bgp statistics for l2vpn evpn
'show bgp l2vpn evpn statistics' was returning 0 for all stats
because bgp_table_stats_walker bailed out if afi != AFI_IP or AFI_IP6.
Add case condition to catch AFI_L2VPN.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-03-04 02:05:56 +00:00
Donald Sharp
a1b773e287 bgpd: Wait for Install should not always set the flag
If we are filtering a route due to any of the filter reasons
we should not be setting the BGP_NODE_FIB_INSTALL_FIB_PENDING
flag.  This is especially evident with say a loopback that
is covered by a network statement.  When we receive the route
back from our peer we should not be setting the
BGP_NODE_FIB_INSTALL_PENDING flag on it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-03-01 13:09:11 -05:00
Mark Stapp
15869cd81d
Merge pull request #8035 from qlyoung/remove-more-sprintf
*: remove more sprintf()
2021-02-23 15:55:02 -05:00
Donatas Abraitis
2031dbf31c
Merge pull request #7444 from sudhanshukumar22/bgp-clean-dampening-issue
bgpd: clear ip bgp dampening was not triggering the route calculation…
2021-02-22 09:37:04 +02:00
Donatas Abraitis
ef1a9fc47a
Merge pull request #8050 from taspelund/bgp_vpn_advertised_routes
bgpd: fix empty advertised-routes for 2-tier safis
2021-02-15 22:38:17 +02:00
Trey Aspelund
d9478df0dc bgpd: fix empty advertised-routes for 2-tier safis
'show bgp ipv[46] vpn neighbors ... advertised-routes' was displaying
empty output due to new command syntax using show_adj_routes() which
assumed each bgp_table was single-tier (not nested).  This fixes that
assumption for safis with a two-tier bgp_table (SAFI_MPLS_VPN,
SAFI_ENCAP, and SAFI_EVPN).

Before:
ub18# show bgp ipv6 vpn neighbors 2001:db8:cafe::2 advertised-routes
ub18#

After:
ub20# show bgp ipv6 vpn neighbors 2001:db8:cafe::1 advertised-routes
BGP table version is 2, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
Route Distinguisher: 30:30
*> 2::2/128         ::                       0    100  32768 i
*> 2::22/128        ::                       0    100  32768 i
Route Distinguisher: 33:33
*> 2::2/128         ::                       0    100  32768 i
*> 2::22/128        ::                       0    100  32768 i

Total number of prefixes 4

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2021-02-11 21:04:10 +00:00
Donatas Abraitis
bcab253c22 bgpd: Replace typo "Cluser length" => "Cluster length"
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-02-11 17:11:12 +02:00
Martin Winter
7a9c641d5c
Merge pull request #7917 from pjdruddy/l3vpn-mpls-snmp-upstream-1
L3vpn mpls snmp upstream 1
2021-02-10 01:37:58 +01:00
Quentin Young
7533cad751 *: remove more sprintf()
Should be just a couple non-development, non-test occurrences of this
function left now.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2021-02-09 15:40:40 -05:00
Donald Sharp
04aabf1b27
Merge pull request #8027 from ton31337/fix/remove_json_aggregatorasmalformed
bgpd: Remove aggregatorAsMalformed related outputs JSON and non-JSON
2021-02-08 20:11:54 -05:00
zyxwvu Shi
aeadbd9e19 bgpd: Do not compare attr again.
`same_attr` has been computed and `hook_call(bgp_process)` (calling
BMP module) would not change it. We could reuse the value to filter
same attribute updates, avoiding an extra comparison.

Signed-off-by: zyxwvu Shi <i@shiyc.cn>
2021-02-08 20:09:02 +08:00
Donatas Abraitis
88d495a961 bgpd: Remove aggregatorAsMalformed related outputs JSON and non-JSON
Already not necessary, because if BGP aggregator AS attribute is with
value of 0, then the attribute is already discarded at early processing.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-02-06 13:45:30 +02:00
sudhanshukumar22
c8ddbd4804 bgpd: clear ip bgp dampening was not triggering the route calculation for the prefix
Description:
    clear ip bgp dampening was not triggering the route
    calculation for the prefix, Due to this prefix are not install in
    RIB(Zebra) and not adv to neighbor

Problem Description/Summary :
    clear ip bgp dampening was not triggering the route
    calculation for the prefix, Due to this prefix are not install in
    RIB(Zebra) and not adv to neighbor

    Fix: When clear ip bgp dampening, route are put for route-calculation as
    that it is install in the Zebra and adv to neighbor.

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2021-02-02 03:16:04 -08:00
Pat Ruddy
7fd28dd245 bgpd: add mplsL3VpnVrfPerfTable support
support for counts of per-vrf routes:
added
deleted
current

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-02-02 09:37:10 +00:00
Donald Sharp
62e0464d73 bgpd: Remove #if 0 code
Remove all dead #if 0 code from bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-28 13:57:49 -05:00
Donatas Abraitis
218c799eae
Merge pull request #7433 from sudhanshukumar22/bgp-aggregate-member-issue
bgpd:'bgpd' core generated on Leaf device with system-test config
2021-01-28 10:34:22 +02:00
Pat Ruddy
4053e9520a bgpd: make sure nh is valid for MPLS vpn routes
If we are using a nexthop for a MPLS VPN route make sure the
nexthop is over a labeled path. This new check mirrors the one
in validate_paths (where routes are enabled when a nexthop
becomes reachable). The check is introduced to the code path
where routes are added and the nexthop is looked up.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-27 13:56:45 +00:00
Donatas Abraitis
b4efa101a8 bgpd: Assert that community_str2com("no-export") always returns non-NULL
community_str2com("no-export"); returns ALWAYS non-NULL.

If NULL returned here, we really have a bigger problems in the call path.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:51:22 +02:00
Donatas Abraitis
aade37d727 bgpd: Set no-export community for blackhole tagged prefixes
RFC says to prevent propagation of the prefix outside the local AS.

So, let's use NO_EXPORT.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-25 09:09:37 +02:00
Donatas Abraitis
9e2912897d bgpd: Log prefix when community filter fails
This is needed when NO_ADVERTISE or NO_EXPORT is handled for outgoing
updates.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-24 10:48:41 +02:00
Donald Sharp
f939c3a69f
Merge pull request #7899 from ton31337/fix/bgpd_blackhole_community
bgpd: Massage Blackhole community
2021-01-22 08:36:27 -05:00
Sarita Patra
d5f2046840 bgpd : multiple memory leak fixes in show commands
Issue: bgpd got kill due to out of memory, when show bgp
neighbor json and show ip bgp neighbor <ip> routes json
commands executed multiple times in a setup having 320554
routes.

RCA: Heap allocated for bgpd keeps increasing. This is verified
using top command and show memory command.

Memleak Fix-1: show ip bgp route json command
When dumping a large bit of table data via bgp_show_route
and if there is no information to display for a particular
struct bgp_node *` the data allocated via json_object_new_array()
is not freed. This is resolved now.

Memleak Fix-2:
The function bgp_peer_counts() doesn't free the memory allocated for
json_loop when there is No such neighbor or address family. This is
fixed now.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2021-01-21 21:15:23 -08:00
Donatas Abraitis
2721dd613f bgpd: Set NO_ADVERTISE community if blackhole community received
rfc7999:
A BGP speaker receiving an announcement tagged with the BLACKHOLE
community SHOULD add the NO_ADVERTISE or NO_EXPORT community as
defined in [RFC1997], or a similar community, to prevent propagation
of the prefix outside the local AS.  The community to prevent
propagation SHOULD be chosen according to the operator's routing
policy.

Sent:
```
router bgp 65534
 no bgp ebgp-requires-policy
 neighbor 192.168.0.2 remote-as 65030
 !
 address-family ipv4 unicast
  redistribute connected
  neighbor 192.168.0.2 route-map spine out
 exit-address-family
 !
!
ip prefix-list self seq 5 permit 192.168.100.1/32
!
route-map spine permit 10
 match ip address prefix-list self
 set community blackhole
!
```

Received:
```
spine1-debian-9# show ip bgp 192.168.100.1/32
BGP routing table entry for 192.168.100.1/32
Paths: (1 available, best #1, table default, inform peer to blackhole prefix)
  Not advertised to any peer
  65534
    192.168.0.1 from 192.168.0.1 (192.168.100.1)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Community: blackhole no-advertise
      Last update: Thu Jan 21 12:56:39 2021
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-21 16:00:53 +02:00
sudhanshukumar22
a4559740ea bgpd:'bgpd' core generated on Leaf device with system-test config
Description:
aggregate member route was enqueued for recalculation
    while bgp instance was deleted.
    As part of aggregate member route deletion, the aggregate route is
    reinstalled with self-peer as source, but self-peer is already removed.
    Assert() for null peer pointer is path attribute aborts bgp.
Problem Description/Summary :
BGP crashed while cleaning up aggregate route as part of bgp instance deletion.
-----------------------
Leaf-4(config)#
Leaf-4(config)# no router bgp 65179 vrf Vrf-red
Leaf-4(config)# no router bgp 65179
Leaf-4(config)#
Leaf-4(config)#
Leaf-4(config)# root@Leaf-4:~#

Sep 26 15:38:21.257554 System is not ready - Core services are down
------------
router bgp 65179
bgp router-id 100.2.0.3
no bgp default ipv4-unicast
bgp network import-check
neighbor LeafToHostv4 peer-group
neighbor LeafToHostv4 remote-as 65003
neighbor LeafToHostv6 peer-group
neighbor LeafToHostv6 remote-as 65003
neighbor LeafToSpinev4 peer-group
neighbor LeafToSpinev4 remote-as 65134
neighbor LeafToSpinev4 bfd
neighbor LeafToSpinev6 peer-group
neighbor LeafToSpinev6 remote-as 65134
neighbor LeafToSpinev6 bfd
neighbor WindowsServer peer-group
neighbor WindowsServer remote-as 65201
neighbor 155.1.0.4 peer-group LeafToSpinev4
neighbor 155.2.0.4 peer-group LeafToSpinev4
neighbor 2000:155:1::4 peer-group LeafToSpinev6
neighbor 2000:155:2::4 peer-group LeafToSpinev6
neighbor 172.16.11.2 peer-group WindowsServer
neighbor 172.16.1.2 remote-as 65101
neighbor 2000:172:16:1::2 remote-as 65101
bgp listen limit 400
bgp listen range 133.3.0.0/16 peer-group LeafToHostv4
bgp listen range 2000:133:3::/48 peer-group LeafToHostv6
!
address-family ipv4 unicast
aggregate-address 133.1.0.0/16 as-set
aggregate-address 133.2.0.0/16 as-set
aggregate-address 133.3.0.0/16 as-set
aggregate-address 133.4.0.0/16 as-set
redistribute connected
neighbor LeafToHostv4 activate
neighbor LeafToSpinev4 activate
neighbor LeafToSpinev4 allowas-in 1
neighbor LeafToSpinev4 route-map spine_v4_export out
neighbor WindowsServer activate
neighbor 172.16.1.2 activate
exit-address-family
!
address-family ipv6 unicast
aggregate-address 2000:133:1::/48 as-set
aggregate-address 2000:133:2::/48 as-set
aggregate-address 2000:133:3::/48 as-set
aggregate-address 2000:133:4::/48 as-set
redistribute connected
..
------------
(gdb) bt
name=0x55607dd49090 <_FUNCTION_.23915> "bgp_path_info_add")
at bgpd/bgpd.c:1159
name=name@entry=0x55607dd49090 <_FUNCTION_.23915> "bgp_path_info_add",
peer=<optimized out>) at bgpd/bgpd.c:1158
pi=<optimized out>) at bgpd/bgp_route.c:313
afi=afi@entry=AFI_IP, safi=safi@entry=SAFI_UNICAST,
p=p@entry=0x55607f1c4e10, origin=<optimized out>, aspath=0x55607f4bc8a0,
community=<optimized out>, ecommunity=<optimized out>,
lcommunity=<optimized out>, atomic_aggregate=0 '\000',
aggregate=0x55607f1c4ee0) at bgpd/bgp_route.c:5926
aggr_p=<optimized out>, aggregate=<optimized out>, pi=0x55607f41f9f0,
safi=SAFI_UNICAST, afi=AFI_IP, bgp=0x55607eeba5d0) at bgpd/bgp_route.c:6385
del=del@entry=0x55607f41f9f0, afi=afi@entry=AFI_IP,
--Type <return> to continue, or q <return> to quit--
safi=safi@entry=SAFI_UNICAST) at bgpd/bgp_route.c:6446
pi=0x55607f41f9f0, peer=0x55607ef22c10, afi=AFI_IP, safi=SAFI_UNICAST)
at bgpd/bgp_route.c:2885
data=<optimized out>) at bgpd/bgp_route.c:4125
at lib/workqueue.c:291
at lib/thread.c:1540
at bgpd/bgp_main.c:498
(gdb) fr 5
name=name@entry=0x55607dd49090 <_FUNCTION_.23915> "bgp_path_info_add",
peer=<optimized out>) at bgpd/bgpd.c:1158
1158 bgpd/bgpd.c: No such file or directory.
(gdb) fr 10
pi=0x55607f41f9f0, peer=0x55607ef22c10, afi=AFI_IP, safi=SAFI_UNICAST)
at bgpd/bgp_route.c:2885
2885 bgpd/bgp_route.c: No such file or directory.
(gdb) p peer->lock
$2 = 210
(gdb) p peer->status
$3 = 8
(gdb)
(gdb) p bgp
$11 = (struct bgp *) 0x56121ba315d0
(gdb) p bgp->peer_self
$12 = (struct peer *) 0x0
(gdb) p bgp->name
$13 = 0x0
(gdb) p bgp->name_pretty
$14 = 0x56121bb046a0 "VRF default"
(gdb) p bgp->inst_type
$15 = BGP_INSTANCE_TYPE_DEFAULT
(gdb)

bgp_aggregate_install():
5920
5921 new = info_make(ZEBRA_ROUTE_BGP, BGP_ROUTE_AGGREGATE, 0,
5922 bgp->peer_self, attr, rn);
5923
5924 SET_FLAG(new->flags, BGP_PATH_VALID);
5925
5926 bgp_path_info_add(rn, new);
5927 bgp_process(bgp, rn, afi, safi);

299 void bgp_path_info_add(struct bgp_node *rn, struct bgp_path_info *pi):
...
310
311 bgp_path_info_lock(pi);
312 bgp_lock_node(rn);
313 peer_lock(pi->peer); /* bgp_path_info peer reference */ <<< This points to bgp->peer_self = NULL
314 }

1573 #define peer_lock(B) peer_lock_with_caller(_FUNCTION_, (B))

1156 /* increase reference count on a struct peer */
1157 struct peer *peer_lock_with_caller(const char *name, struct peer *peer)
1158 {
1159 assert(peer && (peer->lock >= 0)); <<< asserted here
1160

Similar issue was fixed in community and we already have the fix:
https://github.com/FRRouting/frr/pull/4816
root@sr407497_lxc2:/home/ubuntu/frr_repo/frr/bgpd# git diff dfb6fd1dd119a5bd660012e940e8328534547e76~ dfb6fd1dd1
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index abad1db..a372568 100644
— a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -5332,6 +5332,13 @@ static void bgp_purge_af_static_redist_routes(struct bgp *bgp, afi_t afi,
struct bgp_node *rn;
struct bgp_path_info *pi;

+ /* Do not install the aggregate route if BGP is in the
+ * process of termination.
+ */
+ if (bgp_flag_check(bgp, BGP_FLAG_DELETE_IN_PROGRESS) ||
+ (bgp->peer_self == NULL))
+ return;
+
table = bgp->rib[afi][safi];
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
for (pi = bgp_node_get_bgp_path_info(rn); pi; pi = pi->next) {

But looks like similar handling is required at other places as well:

Expected Behavior :
BGP daemon should not crash

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
2021-01-18 01:33:56 -08:00
Donald Sharp
484eabb1d7
Merge pull request #7439 from opensourcerouting/bgp-damp-profile2
bgpd: BGP route-flap dampening profiles for peers and peer groups
2021-01-12 11:45:41 -05:00
Russ White
f3c5ce84e2
Merge pull request #7247 from ton31337/feature/enhanced_route_refresh_capability
bgpd: Enhanced Route Refresh capability
2021-01-12 11:27:11 -05:00
Donald Sharp
7df0e6bb3b
Merge pull request #7756 from pjdruddy/bgplu-fixes
Bgplu fixes
2021-01-09 15:48:22 -05:00
Donald Sharp
92269aa253 bgpd: Allow more detailed knowledge of bgp's internal state
When bgp is using wait for install semantics it would be nice
to be able to debug it when it is running.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-01-05 15:37:33 -05:00
Donatas Abraitis
9af52ccf81 bgpd: Implement enhanced route refresh capability
16:40:49 BGP: 192.168.0.2: sending route-refresh (BoRR) for IPv4/unicast
16:40:51 BGP: 192.168.0.2: sending route-refresh (EoRR) for IPv4/unicast

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2021-01-05 20:19:41 +02:00
Pat Ruddy
992dd67ec7 bgpd: refactor label allocation code
To prepare for fixing an issue where labels do not get released back
to the labelpool when the route is deleted some refactoring is
necessary. There are 2 parts to this.
1. restructure the code to remove the circular nature of label
allocations via the labelpool and decouple the label type decision
from the notification fo the FEC.
The code to notify the FEC association to zebra has been split out
into a separate function so that it can be called from the synchronous
path (for registration of index-based labels and de-registration of all
labels), and from the asynchronous path where we need to wait for a
callback from the labelpool code with a label allocation.
The decision about whether we are using an index-based label or an
allocated label is reflected in the state of the BGP_NODE_LABEL_REQUESTED
flag so the checks on the path_info in the labelpool callback code are
no longer required.
2. change the owned of a labelpool allocated label from the path info
structure to the bgp_dest structure. This allows labels to be released
(in a subsequent commit) when the owner (bgp_dest) goes away.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2021-01-04 14:29:44 +00:00
Donald Sharp
d6bbfefe14 bgpd: Remove awful test of strmatch + get_afi_safi_str
Remove awful test of a strmatch against a call to get_afi_safi_str.
These are the easy ones as that the real decision point is/was
underneath this test.  This is just duplicate expensive testing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-17 16:49:20 -05:00
Donald Sharp
3742de8d68 bgpd: Use the header
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-12-17 16:42:33 -05:00
Chirag Shah
1c00fb274c bgpd: local routes use non-default distance
Use user provided AD for local routes (aggregate).

 address-family ipv4 unicast
  distance bgp 20 200 210
  network 47.2.2.8/30
  aggregate-address 51.1.0.0/16

Testing Done:

Before aggr route uses default 200 AD even user provided local AD.
B>* 51.1.0.0/16 [200/0] unreachable (blackhole), weight 1, 00:01:14

After:
B>* 51.1.0.0/16 [210/0] unreachable (blackhole), weight 1, 00:00:01

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-12-09 16:28:17 -08:00
Chirag Shah
801bb996a4 bgpd: fix distance for aggregate route
bgp aggregate address installs route with self peer which
can have peer->su of unspecifed type.
bgp_distance_apply bailed out as it fails to parse
sockunion2hostprefix for af type unspec.

config:
 address-family ipv4 unicast
  aggregate-address 50.1.0.0/16 summary-only

Testing Done:

Before:
B>* 50.1.0.0/16 [20/0] unreachable (blackhole), weight 1, 00:00:02

After:
B>* 50.1.0.0/16 [200/0] unreachable (blackhole), weight 1, 00:01:28

Signed-off-by: Chirag Shah <chirag@nvidia.com>
2020-12-07 08:31:04 -08:00
Donatas Abraitis
bbb46eb5ae bgpd: Show best path reason in JSON output for show bgp command
exit1-debian-9# show ip bgp json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "192.168.255.1",
 "defaultLocPrf": 100,
 "localAS": 65000,
 "routes": { "172.16.255.254/32": [
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"First path received",
    "pathFrom":"external",
    "prefix":"172.16.255.254",
    "prefixLen":32,
    "network":"172.16.255.254\/32",
    "metric":0,
    "weight":0,
    "peerId":"192.168.255.2",
    "path":"65001",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.255.2",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
],"192.168.255.0/24": [
  {
    "valid":true,
    "bestpath":true,
    "selectionReason":"First path received",
    "pathFrom":"external",
    "prefix":"192.168.255.0",
    "prefixLen":24,
    "network":"192.168.255.0\/24",
    "metric":0,
    "weight":0,
    "peerId":"192.168.255.2",
    "path":"65001",
    "origin":"incomplete",
    "nexthops":[
      {
        "ip":"192.168.255.2",
        "hostname":"exit1-debian-9",
        "afi":"ipv4",
        "used":true
      }
    ]
  }
] }  }

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-12-01 22:36:05 +02:00
Anuradha Karuppiah
229587fb46 bgpd: commands to display L3 NHGs and MAC-IP paths linked to an ES
Sample output -
===============
torm-11# sh bgp l2vpn evpn es-vrf
ES-VRF Flags: A Active
ESI                            VRF             Flags IPv4-NHG IPv6-NHG Ref
03:44:38:39:ff:ff:01:00:00:01  vrf3            A     1        0        2
03:44:38:39:ff:ff:01:00:00:01  vrf2            A     6        0        4
03:44:38:39:ff:ff:01:00:00:01  vrf1            A     7        0        4
03:44:38:39:ff:ff:01:00:00:02  vrf3            A     2        0        2
03:44:38:39:ff:ff:01:00:00:02  vrf2            A     4        0        4
03:44:38:39:ff:ff:01:00:00:02  vrf1            A     8        0        4

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-11-24 11:06:08 -08:00
Anuradha Karuppiah
26c03e43fb bgpd: Handle ES VTEP add/del to a host route
1. MAC-IP routes in the VPN routing table are linked to the
destination ES for efficient handling for remote ES link flaps.
2. Only MAC-IP paths whose nexthops are active (added via EAD-ES)
are imported into the VRF routing table.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-11-24 11:06:08 -08:00
Donald Sharp
0154d8ce45 bgpd, lib, nhrpd, zebra: verify return of sockunion2hostprefix
The return from sockunion2hostprefix tells us if the conversion
succeeded or not.  There are places in the code where we
always assume that it just `works`, since it can fail
notice and try to do the right thing.

Please note that failure of this function for most cases
of sockunion2hostprefix is highly highly unlikely as that
the sockunion was already created and tested elsewhere
it's just that this function can fail.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-18 11:04:27 -05:00
Donald Sharp
a08ccc5e31
Merge pull request #7541 from ton31337/fix/hardcoded_function_names
bgpd: Use __func__ instead of hardcoded strings for some functions
2020-11-17 09:28:09 -05:00
Donald Sharp
399ef80cc3
Merge pull request #7540 from ton31337/fix/typo
*: Replace typo (supress => suppress)
2020-11-17 08:13:17 -05:00
Russ White
2bd9d50ca1
Merge pull request #7523 from donaldsharp/route_map_object_t
*: Remove route_map_object_t from the system
2020-11-17 07:16:12 -05:00
Donatas Abraitis
84c320dc01 bgpd: Use __func__ instead of hardcoded strings for some functions
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-11-17 13:32:15 +02:00
Donatas Abraitis
7c98d487b8 *: Replace typo (supress => suppress)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-11-17 12:13:38 +02:00
Donatas Abraitis
e5c317bcfa
Merge pull request #7526 from donaldsharp/i_am_a_robot_wumpalump
Cleanup on Aisle 5: Memory leaks, Uninited data and code snarfles
2020-11-16 17:32:30 +02:00
Donatas Abraitis
3dbaf077d4
Merge pull request #7461 from donaldsharp/attribute_setget
Attribute setget
2020-11-16 12:20:40 +02:00
Donald Sharp
6c924775b5 bgpd: Convert attr->evpn_overlay to accessor functions
Convert usage of the attr->evpn_overlay to get/set functionality.
Future commits will allow us to abstract this data to when
we actually need it for the `struct attr`.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-15 09:49:14 -05:00
Donald Sharp
779fee9303 bgpd: Abstract attr->cluster to accessor/set functions
Abstract the access of `attr->cluster` to appropriate
accessor/set functionality.

Future commits will allow us to move this data around
to make `struct attr` smaller.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-15 09:44:47 -05:00