Commit Graph

21766 Commits

Author SHA1 Message Date
Soman K S
a77e2f4bab bgpd: Advertise FIB installed routes to bgp peers (Part 3)
* Process FIB update in bgp_zebra_route_notify_owner() and call
  group_announce_route() if route is installed
* When bgp update is received for a route which is not installed earlier
  (flag BGP_NODE_FIB_INSTALLED is not set) and suppress fib is enabled
  set the flag BGP_NODE_FIB_INSTALL_PENDING to indicate fib install is
  pending for the route. The route will be advertised when zebra send
  ZAPI_ROUTE_INSTALLED status.
* The advertisement delay (BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME)
  is added to allow more routes to be sent in single update message.
  This is required since zebra sends route notify message for each route.
  The delay will be applied to update group timer which advertises
  routes to peers.

Signed-off-by: kssoman <somanks@gmail.com>
2020-11-06 08:55:56 +05:30
Soman K S
c208c58670 bgpd: Advertise FIB installed routes to bgp peers (Part 2)
* Added CLI command "[no] bgp suppress-fib-pending" to enable and
  disable suppress-fib-pending
* Send ZEBRA_ROUTE_NOTIFY_REQUEST to zebra when "bgp suppress-fib-pending"
  is enabled or disabled
* Define BGP_DEFAULT_UPDATE_ADVERTISEMENT_TIME which is the delay added
  to update group timer.
* Added error codes

Signed-off-by: kssoman <somanks@gmail.com>
2020-11-06 08:46:04 +05:30
Soman K S
77b38a4a7d bgpd: Advertise FIB installed routes to bgp peers (Part 1)
Issue:
The bgp routes learnt from peers which are not installed in kernel are
advertised to peers. This can cause routers to send traffic to these
destinations only to get dropped. The fix is to provide a configurable
option "bgp suppress-fib-pending". When the option is enabled, bgp will
advertise routes only if it these are successfully installed in kernel.

Fix (Part1) :
* Added message ZEBRA_ROUTE_NOTIFY_REQUEST used by client to request
  FIB install status for routes
* Added AFI/SAFI to ZAPI messages
* Modified the functions zapi_route_notify_decode(), zsend_route_notify_owner()
  and route_notify_internal() to include AFI, SAFI as parameters

Signed-off-by: kssoman <somanks@gmail.com>
2020-11-06 08:39:28 +05:30
Donald Sharp
164f94a452
Merge pull request #7466 from idryzhov/fix-bfd-null-deref
bfdd: fix possible null dereference
2020-11-05 20:54:02 -05:00
Donald Sharp
e5209541f2 bgpd: Actually return the group peer
The code is returning the group peer data structure, which
is what is happening but we should not have assignment statements
in this return statement for a `struct peer *` return.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-05 20:44:31 -05:00
Russ White
9f6c4d4d16
Merge pull request #7227 from chiragshah6/yang_dev
bgpd, yang : neighbor and peer-group config cmds to transactional clis
2020-11-05 14:32:39 -05:00
Donald Sharp
9811fcdca3
Merge pull request #7137 from kssoman/ospf
ospf6d : Intra area route for connected prefix not installed
2020-11-05 11:57:50 -05:00
Igor Ryzhov
1db60b576b bfdd: fix possible null dereference
bs->ifp may be null, so we should check it before dereferencing.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-11-05 19:46:27 +03:00
Mark Stapp
f52e45dbdb
Merge pull request #7459 from donaldsharp/clang_more_stuff_to_cleanup
Clang more stuff to cleanup
2020-11-05 08:25:40 -05:00
Russ White
40ef77c702
Merge pull request #7423 from donaldsharp/route_list
bgpd: Remove pointer structure from `struct bgp_dest`
2020-11-05 07:29:54 -05:00
github login name
6a5bb30062 ospf6d: Json support added for command "show ipv6 ospf6 neighbor [json]"
Modify code to add JSON format output in show command
"show ipv6 ospf6 neighbor" with proper formating

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2020-11-04 22:44:21 -08:00
Donald Sharp
56c226e773 bgpd: Cleanup memory leaks associated with t_router_timer
We are allocating temporary memory for information about
what to process in this thread, which is not being cleaned
up on thread cancelling.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 21:02:57 -05:00
Quentin Young
4eddb67834 doc: add crosslink to developer docs
for source build instructions

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-11-04 17:33:17 -05:00
Quentin Young
d7432defac doc: explain integrated config
This is poorly documented and confusing to users

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-11-04 17:29:58 -05:00
Quentin Young
3ea3aff99d doc: add troubleshooting info for vrrp
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-11-04 17:21:33 -05:00
Mark Stapp
72327cf3e7 * : clean up format specifiers for gcc-10
gcc 10 complains about some of our format specs, fix them. Use
atomic size_t in thread stats, to work around platform
differences.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-11-04 16:56:17 -05:00
Russ White
898fde3c1d
Merge pull request #7456 from donaldsharp/flowspec_issues
Rules and why they are made to be broken
2020-11-04 15:41:35 -05:00
Donald Sharp
26742171e6 bgpd: Remove pointer structure from struct bgp_dest
The `struct listnode *rt_node` data structure is adding
8 bytes of size to the `struct bgp_dest`.  This is a large
amount of data for a flag we are already setting on each
node for this.  Just set the flag and use that to figure
out who we are doing graceful restart on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 15:18:01 -05:00
Renato Westphal
e02c9b9f8f isisd: update more northbound callbacks to new error handling model
This is a second iteration of commit 10bdc68f0c. Some recent
commits introduced zlog calls in the northbound callbacks
inadvertently.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-04 17:12:30 -03:00
Renato Westphal
2f7cc7bcd3 isisd: detect Prefix-SID collisions and handle them appropriately
isisd relies on its YANG module to prevent the same SID index
from being configured multiple times for different prefixes. It's
possible, however, to have different routers assigning the same SID
index for different prefixes. When that happens, we say we have a
Prefix-SID collision, which is ultimately a misconfiguration issue.

The problem with Prefix-SID collisions is that the Prefix-SID that
is processed later overwrites the previous ones. Then, once the
Prefix-SID collision is fixed in the configuration, the overwritten
Prefix-SID isn't reinstalled since it's already marked as installed
and it didn't change. To prevent such inconsistency from happening,
add a safeguard in the SPF code to detect Prefix-SID collisions and
handle them appropriately (i.e. log a warning + ignore the Prefix-SID
Sub-TLV since it's already in use by another prefix). That way,
once the configuration is fixed, no Prefix-SID label entry will be
missing in the LFIB.

Reported-by: Emanuele Di Pascale <emanuele@voltanet.io>
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-04 17:12:30 -03:00
Renato Westphal
28315916a2 isisd: fix build errors when EXTREME_DEBUG is defined
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-11-04 17:12:30 -03:00
Donald Sharp
9535a960a8
Merge pull request #7443 from opensourcerouting/gcc-10-plugin-ice
tools/gcc-frr-format: fix ICE in gcc-10
2020-11-04 14:40:32 -05:00
Donald Sharp
9ea714e143 zebra: Rework code to make SA happy
Clan SA was saying:

./zebra/zebra_vty_clippy.c: In function ‘show_route’:
zebra/zebra_vty.c:1775:4: warning: ‘zvrf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    do_show_ip_route_all(vty, zvrf, afi, !!fib, !!json, tag,
    ^

I do not see a way that zvrf could ever be uninited in the code path
but rearrange the code a tiny bit to make it happier.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 11:48:49 -05:00
Donald Sharp
fddbafcc9e ospfd: Cleanup some clang sa issues
This commit tells the compiler we are intentionally ignoring
the lsa value returned and not doing anything with ret.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 11:47:57 -05:00
Donald Sharp
e95666cbe2 bgpd: Fix up rule encoding to zebra so it works
Recent changes to the rule encoding that were made
did not get reflected in bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 09:11:53 -05:00
Donald Sharp
c195ae78e9 pbrd: Fix memory leak in json output
Fix a memory leak in using some pbr json commands.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-04 09:11:13 -05:00
Donatas Abraitis
626d165d04
Merge pull request #7447 from donaldsharp/table_stats
bgpd: Allow 1 prefix to generate statistics
2020-11-04 08:46:26 +02:00
Lou Berger
dc7b85a2f9
Merge pull request #7274 from donaldsharp/bgp_best_is_a_path
bgpd: allow bestpath to handle mutliple locally-originated paths
2020-11-03 16:06:48 -05:00
Donald Sharp
2b6b4a54cc bgpd: Allow 1 prefix to generate statistics
When generating a config with 1 prefix:

BGP IPv4 Unicast RIB statistics
Total Advertisements          :            0
Total Prefixes                :            0
Average prefix length         :         0.00
Unaggregateable prefixes      :            0
Maximum aggregateable prefixes:            0
BGP Aggregate advertisements  :            0
Address space advertised      :            0
                  % announced :         0.00
                /8 equivalent :         0.00
               /24 equivalent :         0.00

Advertisements with paths     :            0
Longest AS-Path (hops)        :            0
Average AS-Path length (hops) :         0.00
Largest AS-Path (bytes)       :            0
Average AS-Path size (bytes)  :         0.00
Highest public ASN            :            0
eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 329 vrf-id 0
BGP table version 1
RIB entries 1, using 192 bytes of memory
Peers 1, using 23 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.161.131 4      60000        24        27        0    0    0 00:01:05     (Policy)        1

Total number of neighbors 1

We are not displaying it in the statistics data.  This is because FRR is walking the associated
table and comparing the current dest to the top of the tree.  I have no idea why this is
the case as that when you have 1 prefix you only have 1 node in your tree.  Looking at the
code this is the original code that was imported in 2006.  I cannot think of any reason why
FRR needs to exclude this particular node.

Fixed:
eva# show bgp ipv4 uni summ
BGP router identifier 10.10.3.11, local AS number 329 vrf-id 0
BGP table version 1
RIB entries 1, using 192 bytes of memory
Peers 1, using 23 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt
192.168.161.131 4      60000        24        27        0    0    0 00:01:05     (Policy)        1

Total number of neighbors 1
eva# show bgp ipv4 statistics
BGP IPv4 Unicast RIB statistics (VRF default)
Total Advertisements          :            1
Total Prefixes                :            1
Average prefix length         :        32.00
Unaggregateable prefixes      :            1
Maximum aggregateable prefixes:            0
BGP Aggregate advertisements  :            0
Address space advertised      :            1
                  % announced :         0.00
                /8 equivalent :         0.00
               /24 equivalent :         0.00

Advertisements with paths     :            1
Longest AS-Path (hops)        :            0
Average AS-Path length (hops) :         0.00
Largest AS-Path (bytes)       :            0
Average AS-Path size (bytes)  :         0.00
Highest public ASN            :            0
eva#

Fixes: #7422
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-03 15:24:03 -05:00
Lou Berger
aeef9fceb4
Merge pull request #7438 from donaldsharp/multipath_no_alloc
bgpd: Multipath is always being allocated
2020-11-03 10:38:03 -05:00
Rafael Zalamena
7c62dc76d4
Merge pull request #7261 from Niral-Networks/niral_dev_vrf_ospf6
ospf6d : Transformation changes for ospf6 vrf support.
2020-11-03 11:59:38 -03:00
Olivier Dugeon
e035e7142e
Merge pull request #6795 from rgirada/ospf_db_json
ospfd: json support for ospf database command.
2020-11-03 15:42:03 +01:00
Olivier Dugeon
24479b70fe
Merge pull request #6922 from rgirada/ospf_summarisation
ospfd: Implementation of ospf external route summarization.
2020-11-03 15:34:36 +01:00
Russ White
7dcd8af024
Merge pull request #7427 from mjstapp/dplane_intf_info
zebra: add optional extra data about routes' interfaces
2020-11-03 07:44:45 -05:00
Russ White
a6b628c27b
Merge pull request #7442 from qlyoung/fix-thread-tracepoint-pointer
lib: fix missed pointer update
2020-11-03 07:39:12 -05:00
Donald Sharp
39926498dd
Merge pull request #7421 from ton31337/fix/default-originate_attributes
bgpd: Respect match operations for default-originate, not only prefixes
2020-11-03 07:16:31 -05:00
Donald Sharp
540f3f8ce9
Merge pull request #7440 from pjdruddy/fix_snmp_doc
doc: fix code snippet for net-snmp
2020-11-02 19:56:23 -05:00
David Lamparter
cd67bcf99a tools/gcc-frr-format: fix ICE in gcc-10
gcc-10 has a more strict internal assert for type checks so the plugin
currently causes an Internal Compiler Error.  Fix.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-11-03 00:53:29 +01:00
Quentin Young
b4d6e8559f lib: fix missed pointer update
Function argument changed from thread * to thread ** without updating
the corresponding tracepoint.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-11-02 16:22:54 -05:00
Pat Ruddy
30decfdeea doc: fix code snippet for net-snmp
incorrect formatting in doc

Signed-off-by: Pat Ruddy <pat@voltanet.io>
2020-11-02 16:47:58 +00:00
harios_niral
96117716ba ospf6d : Transformation changes for ospf6 vrf support.
1. Reviews comments taken care.

Signed-off-by: harios_niral <hari@niralnetworks.com>
2020-11-02 08:24:21 -08:00
Donald Sharp
1ba8b2a8bf bgpd: Multipath is always being allocated
The multipath arrays are always being allocated, irrelevant
if we actually have multipath information for a prefix.

This is because the link bandwidth code was always adding the
data structure.  We should not be allocated multipath information
unless we actually have multipath information

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-11-02 10:14:48 -05:00
Mark Stapp
84fa466b68
Merge pull request #7425 from sworleys/Fix-Bgp-Dist-Help
bgpd: fix help for ipv6 under distance src command
2020-11-02 07:54:00 -05:00
rgirada
077abf3b6a ospfd: OSPF external summarisation documentation
Description:
	Documentation for external summarisation feature support.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:35:28 -08:00
rgirada
ac8c9518ab ospfd: OSPF external summarisation debug support
Description:
	Changes to enable/disable debugs for external
	LSA sumarisation.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:34:14 -08:00
rgirada
960417cf06 ospfd: OSPF external summarisation scenarios
Description:
	Aggergation handled in the following scenarios.
	1. Route update from Zebra.
	2. Refresh external LSA.
	3. Processing routemap update.
	4. Self originated lsa processing.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:34:11 -08:00
rgirada
53e44d0594 ospfd: OSPF external LSA summarisation show commands
Description:
	The below show command introduced to diplay all configured
	summary addresss information along with matching corresponding
	external route information.

	show ip ospf [vrf <NAME|all>] summary-address [detail] [json]

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:06:12 -08:00
rgirada
423e71c45a ospfd: External LSA summarisation config commands.
Description:
	The following config commands introduced for external route
	aggregation.

	[no] summary-address A.B.C.D/M [tag (1-4294967295)]
	[no] summary-address A.B.C.D/M no-advertise
	aggregation timer (5-1800)
	no aggregation timer

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 22:02:37 -08:00
rgirada
63f0e9415c ospfd: ospf summarisation core handlers
Description:
Apis for creating/deleting aggregate routes.
Origination of summary route on behalf of matched external routes.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 21:17:26 -08:00
rgirada
ad7222b76c ospfd: Summarisation init/de-init.
Description:
       Summarisation initilisation and de-init apis.
       summary route table will be created as part of initilisation
       at the time of ospf deamon init.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2020-11-01 21:13:20 -08:00