]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #7520 from volta-networks/fix_ospf_mpls_te
Russ White [Tue, 17 Nov 2020 12:18:48 +0000 (07:18 -0500)]
Merge pull request #7520 from volta-networks/fix_ospf_mpls_te

ospfd: reset mpls-te prior to ospf router removal

3 years agoMerge pull request #7523 from donaldsharp/route_map_object_t
Russ White [Tue, 17 Nov 2020 12:16:12 +0000 (07:16 -0500)]
Merge pull request #7523 from donaldsharp/route_map_object_t

*: Remove route_map_object_t from the system

3 years agoMerge pull request #7536 from ton31337/fix/documentation
Russ White [Tue, 17 Nov 2020 12:12:33 +0000 (07:12 -0500)]
Merge pull request #7536 from ton31337/fix/documentation

doc: Replace _ to `` when bolding keyword for recently added BGP commands

3 years agoMerge pull request #7530 from ton31337/fix/safeguard_path->attr
Mark Stapp [Tue, 17 Nov 2020 12:09:54 +0000 (07:09 -0500)]
Merge pull request #7530 from ton31337/fix/safeguard_path->attr

bgpd: Make sure path->attr is not NULL before dereferencing

3 years agodoc: Replace _ to `` when bolding keyword for recently added BGP commands
Donatas Abraitis [Tue, 17 Nov 2020 06:49:01 +0000 (08:49 +0200)]
doc: Replace _ to `` when bolding keyword for recently added BGP commands

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7521 from donaldsharp/set_src_future_us
Donatas Abraitis [Tue, 17 Nov 2020 06:33:59 +0000 (08:33 +0200)]
Merge pull request #7521 from donaldsharp/set_src_future_us

zebra: Allow `set src X` to work on startup

3 years agobgpd: Make sure path->attr is not NULL before dereferencing
Donatas Abraitis [Mon, 16 Nov 2020 16:05:53 +0000 (18:05 +0200)]
bgpd: Make sure path->attr is not NULL before dereferencing

Null-checking "path->attr" suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7533 from donaldsharp/zlog_missing_on_failure
Mark Stapp [Tue, 17 Nov 2020 00:09:38 +0000 (19:09 -0500)]
Merge pull request #7533 from donaldsharp/zlog_missing_on_failure

lib: When aborting log data

3 years agoMerge pull request #7531 from qlyoung/fix-doc-block-quote
Mark Stapp [Mon, 16 Nov 2020 20:28:14 +0000 (15:28 -0500)]
Merge pull request #7531 from qlyoung/fix-doc-block-quote

doc: fix missing space before list

3 years agolib: When aborting log data
Donald Sharp [Mon, 16 Nov 2020 20:12:43 +0000 (15:12 -0500)]
lib: When aborting log data

When a FRR process dies due to SIGILL/SIGABORT/etc attempt
to drain the log buffer.  This code change is capturing
some missing logs that were not part of the log file on
a crash.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: fix missing space before list
Quentin Young [Mon, 16 Nov 2020 17:39:41 +0000 (12:39 -0500)]
doc: fix missing space before list

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #7526 from donaldsharp/i_am_a_robot_wumpalump
Donatas Abraitis [Mon, 16 Nov 2020 15:32:30 +0000 (17:32 +0200)]
Merge pull request #7526 from donaldsharp/i_am_a_robot_wumpalump

Cleanup on Aisle 5: Memory leaks, Uninited data and code snarfles

3 years agoospfd: reset mpls-te prior to ospf router removal
Carlo Galiotto [Fri, 13 Nov 2020 16:35:06 +0000 (17:35 +0100)]
ospfd: reset mpls-te prior to ospf router removal

This commits attempts to fix a problem that occurs when mpls-te gets
removed from ospfd config. Mpls-te has an inter-as option, which can be
set to Off/Area/AS. Whenever the inter-as takes "Area" or "AS" as a
value, this value will not be cleaned after removing mpls-te or after
removing the ospf router. Therefore, if mpls-te is configured with
inter-as AS or Area and we remove mpls-te or the ospf router, the
inter-as will still preserve its value; therefore, next time mpls-te is
enabled, it will automatically inherits the previous inter-as value
(either Area or AS). This leads to wrong configuration, which can be a
problem for frr_reload.py.
The commits forces mpls-te to reset inter-as to Off before it mpls-te
gets removed from the configuration and before the ospf router gets
removed.

Signed-off-by: Carlo Galiotto <carlo@voltanet.io>
3 years agoMerge pull request #7461 from donaldsharp/attribute_setget
Donatas Abraitis [Mon, 16 Nov 2020 10:20:40 +0000 (12:20 +0200)]
Merge pull request #7461 from donaldsharp/attribute_setget

Attribute setget

3 years agoMerge pull request #7510 from donaldsharp/xpath_stay
Donatas Abraitis [Mon, 16 Nov 2020 08:06:08 +0000 (10:06 +0200)]
Merge pull request #7510 from donaldsharp/xpath_stay

lib: Fix crash walking up command chain in bgp commands

3 years agoMerge pull request #7514 from donaldsharp/respect_e
Donatas Abraitis [Mon, 16 Nov 2020 06:57:50 +0000 (08:57 +0200)]
Merge pull request #7514 from donaldsharp/respect_e

bgpd: Respect `-e X` value for multipath

3 years agoMerge pull request #7525 from donaldsharp/dest_lock
Donatas Abraitis [Mon, 16 Nov 2020 06:51:55 +0000 (08:51 +0200)]
Merge pull request #7525 from donaldsharp/dest_lock

bgpd: Fix missed unlocks

3 years agoMerge pull request #7513 from mjstapp/fix_bgp_sa_label
Donald Sharp [Sun, 15 Nov 2020 19:34:09 +0000 (14:34 -0500)]
Merge pull request #7513 from mjstapp/fix_bgp_sa_label

bgpd: fix SA warning

3 years agobgpd: Convert attr->vnc_subtlvs to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 18:44:47 +0000 (13:44 -0500)]
bgpd: Convert attr->vnc_subtlvs to use accessor functions

Add a get/set accessor functions and use them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert attr->evpn_overlay to accessor functions
Donald Sharp [Mon, 2 Nov 2020 17:55:45 +0000 (12:55 -0500)]
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>
3 years agobgpd: Abstract attr->cluster to accessor/set functions
Donald Sharp [Mon, 2 Nov 2020 17:35:20 +0000 (12:35 -0500)]
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>
3 years agobgpd: Convert attr->transit to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 17:09:25 +0000 (12:09 -0500)]
bgpd: Convert attr->transit to use accessor functions

Convert the `struct attr`->transit variable to use
accessor functions.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert ipv6_ecommunity to use accessor functions
Donald Sharp [Mon, 2 Nov 2020 16:12:39 +0000 (11:12 -0500)]
bgpd: Convert ipv6_ecommunity to use accessor functions

Convert the `struct attr`->ipv6_ecommunity to use
accessor functions. We'll be able to reduce memory
usage in the `struct bgp_attr` by doing this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Add accessor for bgp_attr.pmsi_tnl_type
Donald Sharp [Mon, 2 Nov 2020 15:52:40 +0000 (10:52 -0500)]
bgpd: Add accessor for bgp_attr.pmsi_tnl_type

Add an accessor for the bgp_attr.pmsi_tnl_type to allow
us to abstract where it is.  Every attribute is paying
the price of this bit of data as part of `struct bgp_attr`
In the future we'll move it elsewhere.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Allow NULL to be passed in for ecommunity_free
Donald Sharp [Mon, 2 Nov 2020 16:20:32 +0000 (11:20 -0500)]
bgpd: Allow NULL to be passed in for ecommunity_free

Allow some cleanup of if statements to just make
ecommunity_free() check this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobabeld: Free ifc leak
Donald Sharp [Sun, 15 Nov 2020 02:19:42 +0000 (21:19 -0500)]
babeld: Free ifc leak

On removal of an address on an interface babel was not properly
cleaning memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Free aggr_suppresors list on extra deletion
Donald Sharp [Sun, 15 Nov 2020 00:16:57 +0000 (19:16 -0500)]
bgpd: Free aggr_suppresors list on extra deletion

When we delete the bgp_path_info_extra data structure free
the aggr_suppressors data structure that was left dangling.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI
Donald Sharp [Sat, 14 Nov 2020 23:50:37 +0000 (18:50 -0500)]
bgpd, lib, staticd, tests: Convert to using FOREACH_AFI_SAFI

Move the FOREACH_AFI_SAFI macro from bgpd.h to zebra.h( GLOBAL's YOUALL )

Then convert all the places that have the two level for loop to
iterate over all afi/safis

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: If using filters free up name on peer deletion
Donald Sharp [Sat, 14 Nov 2020 23:35:21 +0000 (18:35 -0500)]
bgpd: If using filters free up name on peer deletion

FRR was not properly deleting the aname and cnmae
memory that was allocated if bgp is using filters.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Free created tables
Donald Sharp [Sat, 14 Nov 2020 22:58:40 +0000 (17:58 -0500)]
isisd: Free created tables

On redistribution into isis we were creating a table for
handling the redistributed routes, but never cleaning them
up on shutdown properly.  Do so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: print prefix instead of unininted buf
Donald Sharp [Sat, 14 Nov 2020 22:40:53 +0000 (17:40 -0500)]
bgpd: print prefix instead of unininted buf

The recent change to use %pFX missed a code path
where we were displaying a buf that was uninited.
Display the prefix as intended.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: on debug esi was not properly setup
Donald Sharp [Sat, 14 Nov 2020 22:33:43 +0000 (17:33 -0500)]
bgpd: on debug esi was not properly setup

There exists a code path where the esi would be passed
to a debug without the esi being setup with any values
causing us to display what ever is on the stack.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: On shutdown leaking spf_timer thread data
Donald Sharp [Sat, 14 Nov 2020 22:32:01 +0000 (17:32 -0500)]
isisd: On shutdown leaking spf_timer thread data

When isis is being shutdown the area->spf_timer thread has
special data assigned to that was never being freed.
Free this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobfdd: On interface address delete we are leaking memory
Donald Sharp [Sat, 14 Nov 2020 22:31:21 +0000 (17:31 -0500)]
bfdd: On interface address delete we are leaking memory

The interface address delete callback from zebra was not
deleting the ifc that was created as per normal work methodologies

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: When showing a lcommunity free alloced memory
Donald Sharp [Sat, 14 Nov 2020 21:29:16 +0000 (16:29 -0500)]
bgpd: When showing a lcommunity free alloced memory

We are temporarily allocing memory to show lcommunity
information.  We then immediately drop it.  Account for
that memory properly.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Fix missed unlocks
Donald Sharp [Sat, 14 Nov 2020 20:32:49 +0000 (15:32 -0500)]
bgpd: Fix missed unlocks

When iterating over the bgp_dest table, using this pattern:

for (dest = bgp_table_top(table); dest;
     dest = bgp_route_next(dest)) {

If the code breaks or returns in the middle we will not have
properly unlocked the node as that bgp_table_top locks the top
dest and bgp_route_next locks the next dest and unlocks the old
dest.

From code inspection I have found a bunch of places that
we either return in the middle of or a break is issued.

Add appropriate unlocks.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years ago*: Remove route_map_object_t from the system
Donald Sharp [Sat, 14 Nov 2020 00:35:20 +0000 (19:35 -0500)]
*: Remove route_map_object_t from the system

The route_map_object_t was being used to track what protocol we were
being called against.  But each protocol was only ever calling itself.
So we had a variable that was only ever being passed in from route_map_apply
that had to be carried against and everyone was testing if that variable
was for their own stack.

Clean up this route_map_object_t from the entire system.  We should
speed some stuff up.  Yes I know not a bunch but this will add up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Allow `set src X` to work on startup
Donald Sharp [Fri, 13 Nov 2020 17:06:57 +0000 (12:06 -0500)]
zebra: Allow `set src X` to work on startup

If a route-map in zebra has `set src X` and the interface
X is on has not been configured yet, we are rejecting the command
outright.  This is a problem on boot up especially( and where I
found this issue ) in that interfaces *can* and *will* be slow
on startup and config can easily be read in *before* the
interface has an ip address.

Let's modify zebra to just warn to the user we may have a problem
and let the chips fall where they may.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7512 from mjstapp/fix_doc_bgp_v6
Quentin Young [Fri, 13 Nov 2020 21:04:09 +0000 (16:04 -0500)]
Merge pull request #7512 from mjstapp/fix_doc_bgp_v6

doc: fix dup label in bgp doc

3 years agoMerge pull request #7474 from eololab/fix-crash-skiplist-debug
Mark Stapp [Fri, 13 Nov 2020 15:54:49 +0000 (10:54 -0500)]
Merge pull request #7474 from eololab/fix-crash-skiplist-debug

lib, bgpd: fix crash using skiplist debug function

3 years agobgpd: Respect `-e X` value for multipath
Donald Sharp [Thu, 12 Nov 2020 15:27:24 +0000 (10:27 -0500)]
bgpd: Respect `-e X` value for multipath

When entering values for maximum-path if the user
has entered a value to respect from the bgp cli `-e X`
that is the maximum value we should use when accepting
values from the user.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: fix SA warning
Mark Stapp [Thu, 12 Nov 2020 21:27:31 +0000 (16:27 -0500)]
bgpd: fix SA warning

Fix a coverity warning about an obscure path involving labels.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agodoc: fix dup label in bgp doc
Mark Stapp [Thu, 12 Nov 2020 21:26:25 +0000 (16:26 -0500)]
doc: fix dup label in bgp doc

Make a label about v6 unique.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib: Fix crash walking up command chain in bgp commands
Donald Sharp [Thu, 12 Nov 2020 20:15:52 +0000 (15:15 -0500)]
lib: Fix crash walking up command chain in bgp commands

As part of normal processing we allow bgp commands to walk
up the command node chain.  We are experiencing this crash:

Thread 1 "bgpd" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
    assertion=0x7ffff7f3ba4f "set", file=0x7ffff7f3ba44 "lib/yang.c", line=413, function=<optimized out>)
    at assert.c:92
    line=413, function=0x7ffff7f3bc50 <__PRETTY_FUNCTION__.9> "yang_dnode_get") at assert.c:101
    vty=0x5555561715a0, argc=3, argv=0x555558601620) at bgpd/bgp_vty.c:9568
    cmd=0x0) at lib/command.c:937
    at lib/command.c:997
    matched=0x0, vtysh=0) at lib/command.c:1161
    at lib/vty.c:517
(gdb)

9582 bgp_glb_dnode = yang_dnode_get(vty->candidate_config->dnode,
(gdb) p vty->xpath
$8 = {
  "/frr-routing:routing/control-plane-protocols/control-plane-protocol[type='frr-bgp:bgp'][name='bgp'][vrf='default']/frr-bgp:bgp", '\000' <repeats 897 times>, '\000' <repeats 1023 times>, '\000' <repeats 1023 times>,
  '\000' <repeats 1023 times>, '\000' <repeats 1023 times>, '\000' <repeats 1023 times>, '\000' <repeats 1023 times>,
  '\000' <repeats 1023 times>}
(gdb) p vty->xpath_index
$9 = 0
(gdb)

We are effectively sending in an array index based upon vty->xpath_index( which is zero) but
the VTY_CURR_XPATH macro subtracts 1 from that value to find the appropriate xpath to use.
This of course subtracts 1 from 0 and we underflow the array.

The relevant section in a config file is this:

address-family ipv6 flowspec
  bgp maxim...

Effectively we were trying to walk up the command chain for flowspec to see
if the command is entered correctly.  There is a function vty_check_node_for_xpath_decrement
that was looking at bgp sub-modes to make the decision to allow us to decrement
the vty->xpath_index which did not have the v4 or v6 flowspec bgp sub modes in the
check.

Adding them in fixes the problem.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7481 from donaldsharp/memory_options_are_long
Mark Stapp [Thu, 12 Nov 2020 15:17:22 +0000 (10:17 -0500)]
Merge pull request #7481 from donaldsharp/memory_options_are_long

bgpd: Shorten some `show memory` strings

3 years agoMerge pull request #4770 from kssoman/fib
Santosh P K [Thu, 12 Nov 2020 13:29:24 +0000 (18:59 +0530)]
Merge pull request #4770 from kssoman/fib

Advertise FIB installed routes to bgp peers

3 years agobgpd: Shorten some `show memory` strings
Donald Sharp [Sat, 7 Nov 2020 00:56:36 +0000 (19:56 -0500)]
bgpd: Shorten some `show memory` strings

Some of the `show memory` strings in bgp are longer than the
columns we have allocated for it.  Shorten some strings to
make them fit and have the output pleasing to the eye.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7504 from hohl/master
Donald Sharp [Wed, 11 Nov 2020 19:42:27 +0000 (14:42 -0500)]
Merge pull request #7504 from hohl/master

docs: mention activate keyword in user docs

3 years agoMerge pull request #7417 from pjdruddy/pr-stale-vpn-exports
Donald Sharp [Wed, 11 Nov 2020 18:22:21 +0000 (13:22 -0500)]
Merge pull request #7417 from pjdruddy/pr-stale-vpn-exports

bgpd: withdraw any exported routes when deleting a vrf

3 years agodocs: mention activate keyword in user docs
Michael Hohl [Wed, 11 Nov 2020 15:56:15 +0000 (16:56 +0100)]
docs: mention activate keyword in user docs

As of now, the BGP user documentation does not explicitly mention how
to use IPv6. This commit adds documentation of the activate command to
the user documentation which is crucial to get IPv6 networks announced
using FRRouting.

Signed-off-by: Michael Hohl <me@michaelhohl.net>
3 years agobgpd: withdraw any exported routes when deleting a vrf
Pat Ruddy [Thu, 29 Oct 2020 16:38:42 +0000 (16:38 +0000)]
bgpd: withdraw any exported routes when deleting a vrf

When a BGP vrf instance is deleted, the routes it exported into the
main VPN table are not deleted and they remain as stale routes
attached to an unknown bgp instance. When the new vrf instance comes
along, it imports these routes from the main table and thus we see
duplicatesalongside its own identical routes.
The solution is to call the unexport logic when a BGP vrf instance is
being deleted.

problem example
---------------
volta1# sh bgp vrf VRF-a ipv4 unicast
BGP table version is 4, local router ID is 18.0.0.1, vrf id 5
Default local pref 100, local AS 567
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
*> 7.0.0.6/32       7.0.0.5@0<              10    100      0 ?
*> 7.0.0.8/32       18.0.0.8                 0             0 111 ?
*> 18.0.0.0/24      18.0.0.8                 0             0 111 ?
*> 56.0.0.0/24      7.0.0.5@0<               0    100      0 ?
Displayed  4 routes and 4 total paths
volta1# conf t
volta1(config)# no router bgp 567 vrf VRF-a
volta1(config)#
volta1(config)# router bgp 567 vrf VRF-a
volta1(config-router)#  bgp router-id 18.0.0.1
volta1(config-router)#  no bgp ebgp-requires-policy
volta1(config-router)#  no bgp network import-check
volta1(config-router)#  neighbor 18.0.0.8 remote-as 111
volta1(config-router)#  !
volta1(config-router)#  address-family ipv4 unicast
volta1(config-router-af)#   label vpn export 12345
volta1(config-router-af)#   rd vpn export 567:111
volta1(config-router-af)#   rt vpn both 567:100
volta1(config-router-af)#   export vpn
volta1(config-router-af)#   import vpn
volta1(config-router-af)#  exit-address-family
volta1(config-router)# !
volta1(config-router)# end
volta1# sh bgp vrf VRF-a ipv4 unicast
BGP table version is 4, local router ID is 18.0.0.1, vrf id 5
Default local pref 100, local AS 567
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
*> 7.0.0.6/32       7.0.0.5@0<              10    100      0 ?
*  7.0.0.8/32       18.0.0.8                 0             0 111 ?
*>                  18.0.0.8@-<              0             0 111 ?
*  18.0.0.0/24      18.0.0.8                 0             0 111 ?
*>                  18.0.0.8@-<              0             0 111 ?
*> 56.0.0.0/24      7.0.0.5@0<               0    100      0 ?
Displayed  4 routes and 6 total paths

@- routes indicating unknown bgp instance are imported

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7375 from vishaldhingra/static
Rafael Zalamena [Wed, 11 Nov 2020 12:05:34 +0000 (09:05 -0300)]
Merge pull request #7375 from vishaldhingra/static

staticd: fixed memory leak on shudown

3 years agoMerge pull request #7491 from volta-networks/fix_ebgp_mhop_reset
Donald Sharp [Tue, 10 Nov 2020 23:50:10 +0000 (18:50 -0500)]
Merge pull request #7491 from volta-networks/fix_ebgp_mhop_reset

bgpd: avoid needless ebgp-multihop session reset

3 years agoMerge pull request #7495 from qlyoung/doc-fuzzing
Russ White [Tue, 10 Nov 2020 21:48:31 +0000 (16:48 -0500)]
Merge pull request #7495 from qlyoung/doc-fuzzing

Doc fuzzing

3 years agoMerge pull request #7500 from mjstapp/fix_topo_scale_mem
Donald Sharp [Tue, 10 Nov 2020 21:40:53 +0000 (16:40 -0500)]
Merge pull request #7500 from mjstapp/fix_topo_scale_mem

tests: reduce scale of the route scale test

3 years agoMerge pull request #7498 from mjstapp/fix_topo_count_only
Donald Sharp [Tue, 10 Nov 2020 20:17:59 +0000 (15:17 -0500)]
Merge pull request #7498 from mjstapp/fix_topo_count_only

tests: only test count of nexthops in bgp max-paths test

3 years agoMerge pull request #7482 from AnuradhaKaruppiah/evpn-sticky-fix
Mark Stapp [Tue, 10 Nov 2020 20:13:10 +0000 (15:13 -0500)]
Merge pull request #7482 from AnuradhaKaruppiah/evpn-sticky-fix

zebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY

3 years agoMerge pull request #7499 from mjstapp/fix_topo_dup_verify_fib
Quentin Young [Tue, 10 Nov 2020 20:02:42 +0000 (15:02 -0500)]
Merge pull request #7499 from mjstapp/fix_topo_dup_verify_fib

tests: remove duplicate verify_fib_routes from common_config.py

3 years agotests: reduce scale of the route scale test
Mark Stapp [Tue, 10 Nov 2020 19:14:23 +0000 (14:14 -0500)]
tests: reduce scale of the route scale test

Reduce the number of routes used in the route-scale test: we're
having memory troubles, and this may help the CI run with fewer
false failures. Also re-orged the route-scale test code a bit
so it can be driven from the json file, with fewer hard-coded
values.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agolib, bgpd: fix crash using skiplist debug function
Emanuele Bovisio [Thu, 5 Nov 2020 13:36:00 +0000 (14:36 +0100)]
lib, bgpd: fix crash using skiplist debug function

calling "skiplist test" and then "skiplist debug",
there was a crash due to a freed pointer.

Agreed to remove static pointer (see PR #7474).

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
3 years agoMerge pull request #7484 from donaldsharp/nhrp_leak
Jafar Al-Gharaibeh [Tue, 10 Nov 2020 16:25:16 +0000 (10:25 -0600)]
Merge pull request #7484 from donaldsharp/nhrp_leak

nhrpd: Fix memory leak on shutdown

3 years agoMerge pull request #7448 from mjstapp/fix_gcc10_formats
Donald Sharp [Tue, 10 Nov 2020 16:23:02 +0000 (11:23 -0500)]
Merge pull request #7448 from mjstapp/fix_gcc10_formats

* : clean up format specifiers for gcc-10

3 years agoMerge pull request #7445 from ranjanyash54/dev_4
Russ White [Tue, 10 Nov 2020 16:15:02 +0000 (11:15 -0500)]
Merge pull request #7445 from ranjanyash54/dev_4

ospf6d: Json support added for command "show ipv6 ospf6 neighbor [json]"

3 years agotests: remove duplicate verify_fib_routes from common_config.py
Mark Stapp [Tue, 10 Nov 2020 15:06:48 +0000 (10:06 -0500)]
tests: remove duplicate verify_fib_routes from common_config.py

There were two copies of the function - we only need one.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agotests: only test count of nexthops in bgp max-paths test
Mark Stapp [Tue, 10 Nov 2020 14:50:50 +0000 (09:50 -0500)]
tests: only test count of nexthops in bgp max-paths test

Add support to compare the number of RIB nexthops, rather than the
specific nexthop addresses. Use this in the bgp_ecmp topotests that
test maximum-paths - testing the specific nexthops is wrong there,
it's not deterministic and we get spurious failures.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7463 from louis-oui/netnsname
Donatas Abraitis [Tue, 10 Nov 2020 07:39:43 +0000 (09:39 +0200)]
Merge pull request #7463 from louis-oui/netnsname

lib: change limit of netns name from 15 to 35 characters

3 years agodoc: fix vrrp block quote
Quentin Young [Mon, 9 Nov 2020 21:19:13 +0000 (16:19 -0500)]
doc: fix vrrp block quote

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: use anonymous link refs
Quentin Young [Mon, 9 Nov 2020 20:17:18 +0000 (15:17 -0500)]
doc: use anonymous link refs

rst...

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: add docs on fuzzing stuff
Quentin Young [Mon, 9 Nov 2020 20:08:02 +0000 (15:08 -0500)]
doc: add docs on fuzzing stuff

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #7494 from mjstapp/fix_basic_title_levels
Quentin Young [Mon, 9 Nov 2020 20:24:25 +0000 (15:24 -0500)]
Merge pull request #7494 from mjstapp/fix_basic_title_levels

doc: fix sphinx complaint about indent levels

3 years agodoc: fix sphinx complaint about indent levels
Mark Stapp [Mon, 9 Nov 2020 17:44:44 +0000 (12:44 -0500)]
doc: fix sphinx complaint about indent levels

There was an inconsistency in the characters used for the second
level of title/section hierarchy - fix it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agobgpd: avoid needless ebgp mhop reset
Emanuele Di Pascale [Mon, 9 Nov 2020 10:05:04 +0000 (11:05 +0100)]
bgpd: avoid needless ebgp mhop reset

if the user sets the ebgp-multihop for a neighbor to the same value
we currently have, avoid resetting the session and just return a
silent success.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agolib: change limit of netns name from 15 to 35 characters
Louis Scalbert [Mon, 9 Nov 2020 10:24:53 +0000 (11:24 +0100)]
lib: change limit of netns name from 15 to 35 characters

    Extend the size of netns name to match linux permitted netns name size

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agoMerge pull request #7487 from donaldsharp/reformat_rfapi
Donatas Abraitis [Sun, 8 Nov 2020 15:09:23 +0000 (17:09 +0200)]
Merge pull request #7487 from donaldsharp/reformat_rfapi

bgpd: Fix rfapi indentation issues with a for loop

3 years agoMerge pull request #7486 from ton31337/fix/bgp_debug_keepalives_docstring
Donald Sharp [Sun, 8 Nov 2020 00:20:15 +0000 (19:20 -0500)]
Merge pull request #7486 from ton31337/fix/bgp_debug_keepalives_docstring

bgpd: Correct CLI description for `debug bgp keepalives`

3 years agobgpd: Fix rfapi indentation issues with a for loop
Donald Sharp [Sat, 7 Nov 2020 16:43:44 +0000 (11:43 -0500)]
bgpd: Fix rfapi indentation issues with a for loop

I am not even sure how this compiles or what it is supposed
to do from a c perspective :(

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7462 from qlyoung/fix-misc-doc-issues
Donatas Abraitis [Sat, 7 Nov 2020 15:26:46 +0000 (17:26 +0200)]
Merge pull request #7462 from qlyoung/fix-misc-doc-issues

Fix misc doc issues

3 years agoMerge pull request #7477 from chiragshah6/yang_dev
Donatas Abraitis [Sat, 7 Nov 2020 15:25:37 +0000 (17:25 +0200)]
Merge pull request #7477 from chiragshah6/yang_dev

bgpd: fix compiler warnings in nbr cmd

3 years agobgpd: Correct CLI description for `debug bgp keepalives`
Donatas Abraitis [Sat, 7 Nov 2020 15:22:34 +0000 (17:22 +0200)]
bgpd: Correct CLI description for `debug bgp keepalives`

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #7480 from donaldsharp/bgp_defer_bad_donald
Donatas Abraitis [Sat, 7 Nov 2020 10:21:27 +0000 (12:21 +0200)]
Merge pull request #7480 from donaldsharp/bgp_defer_bad_donald

bgpd: Fix mistakes in defer working

3 years agoMerge pull request #7470 from donaldsharp/bgp_group
Donatas Abraitis [Sat, 7 Nov 2020 10:19:47 +0000 (12:19 +0200)]
Merge pull request #7470 from donaldsharp/bgp_group

bgpd: Actually return the group peer

3 years agonhrpd: Fix memory leak on shutdown
Donald Sharp [Sat, 7 Nov 2020 01:56:02 +0000 (20:56 -0500)]
nhrpd: Fix memory leak on shutdown

On shutdown we were blantantly dropping the node->info
data.  Make it happy.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY
Anuradha Karuppiah [Sat, 9 May 2020 02:53:36 +0000 (19:53 -0700)]
zebra: Set NUD_NOARP on sticky MAC entries in addition to NTF_STICKY

(ndm_state & NUD_NOARP) - prevents the entry from expiring
(ndm_flags & NTF_STICKY) - prevents station moves on the entry

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
3 years agobgpd: Fix mistakes in defer working
Donald Sharp [Sat, 7 Nov 2020 00:13:59 +0000 (19:13 -0500)]
bgpd: Fix mistakes in defer working

Commit: 26742171e6ba292a9fd2a72668315d2a699717b5

Mistakenly reversed the logic for the test on the list length
when it was removed.  Fix this.

Additionally limit for loop to stop when we know there are no
more items to process that have the BGP_NODE_SELECT_DEFER flag.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7473 from eololab/fix-crash-bfdd-show-counters-json
Donald Sharp [Fri, 6 Nov 2020 23:40:07 +0000 (18:40 -0500)]
Merge pull request #7473 from eololab/fix-crash-bfdd-show-counters-json

bfdd: fix crash on show bfd peers counters json

3 years agobgpd: fix compiler warnings in nbr cmd
Chirag Shah [Fri, 6 Nov 2020 19:06:58 +0000 (11:06 -0800)]
bgpd: fix compiler warnings in nbr cmd

Addressed the gcc-10 buffer overflow warnings.
Put a sanity check of not using prefix for
neighbor update-source with interface option.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agobfdd: fix crash on show bfd peers counters json
Emanuele Bovisio [Thu, 5 Nov 2020 13:27:51 +0000 (14:27 +0100)]
bfdd: fix crash on show bfd peers counters json

wrong pointer passed to bfd_id_iterate function

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
3 years agoMerge pull request #7385 from opensourcerouting/isisd-prefix-sid-collision
Olivier Dugeon [Fri, 6 Nov 2020 11:21:37 +0000 (12:21 +0100)]
Merge pull request #7385 from opensourcerouting/isisd-prefix-sid-collision

isisd: detect Prefix-SID collisions and handle them  appropriately

3 years agotests: Advertise FIB installed routes to bgp peers
Soman K S [Fri, 6 Nov 2020 03:29:39 +0000 (08:59 +0530)]
tests: Advertise FIB installed routes to bgp peers

Added test case for bgp suppress-fib-pending
Updated document

Signed-off-by: kssoman <somanks@gmail.com>
3 years agobgpd: Advertise FIB installed routes to bgp peers (Part 3)
Soman K S [Fri, 6 Nov 2020 03:25:56 +0000 (08:55 +0530)]
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>
3 years agobgpd: Advertise FIB installed routes to bgp peers (Part 2)
Soman K S [Fri, 6 Nov 2020 03:16:04 +0000 (08:46 +0530)]
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>
3 years agobgpd: Advertise FIB installed routes to bgp peers (Part 1)
Soman K S [Fri, 6 Nov 2020 03:09:28 +0000 (08:39 +0530)]
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>
3 years agoMerge pull request #7466 from idryzhov/fix-bfd-null-deref
Donald Sharp [Fri, 6 Nov 2020 01:54:02 +0000 (20:54 -0500)]
Merge pull request #7466 from idryzhov/fix-bfd-null-deref

bfdd: fix possible null dereference

3 years agobgpd: Actually return the group peer
Donald Sharp [Fri, 6 Nov 2020 01:42:03 +0000 (20:42 -0500)]
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>
3 years agoMerge pull request #7227 from chiragshah6/yang_dev
Russ White [Thu, 5 Nov 2020 19:32:39 +0000 (14:32 -0500)]
Merge pull request #7227 from chiragshah6/yang_dev

bgpd, yang : neighbor and peer-group config cmds to transactional clis

3 years agoMerge pull request #7137 from kssoman/ospf
Donald Sharp [Thu, 5 Nov 2020 16:57:50 +0000 (11:57 -0500)]
Merge pull request #7137 from kssoman/ospf

ospf6d : Intra area route for connected prefix not installed

3 years agobfdd: fix possible null dereference
Igor Ryzhov [Thu, 5 Nov 2020 16:46:27 +0000 (19:46 +0300)]
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>
3 years agoMerge pull request #7459 from donaldsharp/clang_more_stuff_to_cleanup
Mark Stapp [Thu, 5 Nov 2020 13:25:40 +0000 (08:25 -0500)]
Merge pull request #7459 from donaldsharp/clang_more_stuff_to_cleanup

Clang more stuff to cleanup

3 years agoMerge pull request #7423 from donaldsharp/route_list
Russ White [Thu, 5 Nov 2020 12:29:54 +0000 (07:29 -0500)]
Merge pull request #7423 from donaldsharp/route_list

bgpd: Remove pointer structure from `struct bgp_dest`

3 years agoospf6d: Json support added for command "show ipv6 ospf6 neighbor [json]"
github login name [Mon, 28 Sep 2020 10:48:37 +0000 (03:48 -0700)]
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>