]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoospf6d: Convert to using %pFX
Donald Sharp [Wed, 14 Oct 2020 17:17:36 +0000 (13:17 -0400)]
ospf6d: Convert to using %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Convert to using %pFX
Donald Sharp [Wed, 14 Oct 2020 17:17:14 +0000 (13:17 -0400)]
ospfd: Convert to using %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoripd: Convert to using %pFX
Donald Sharp [Wed, 14 Oct 2020 17:16:46 +0000 (13:16 -0400)]
ripd: Convert to using %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoripngd: Convert to using %pFX
Donald Sharp [Wed, 14 Oct 2020 17:16:23 +0000 (13:16 -0400)]
ripngd: Convert to using %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Convert usage of strings to %pFX and %pRN
Donald Sharp [Wed, 14 Oct 2020 16:57:14 +0000 (12:57 -0400)]
lib: Convert usage of strings to %pFX and %pRN

Convert over to using the %pFX and %pRN modifiers
to output strings to allow us to consolidate on
one standard for printing prefixes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years ago*: Create/Use accessor functions for lock count
Donald Sharp [Wed, 14 Oct 2020 16:44:23 +0000 (12:44 -0400)]
*: Create/Use accessor functions for lock count

Create appropriate accessor functions for the rn->lock
data.  We should be accessing this data through accessor
functions since it is private data to the data structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #7336 from donaldsharp/sharp_one_one
Donatas Abraitis [Sat, 17 Oct 2020 17:31:22 +0000 (20:31 +0300)]
Merge pull request #7336 from donaldsharp/sharp_one_one

sharpd: Fix nexthop group name collision

3 years agoMerge pull request #7330 from donaldsharp/zebra_use_after_free
Donatas Abraitis [Sat, 17 Oct 2020 17:24:11 +0000 (20:24 +0300)]
Merge pull request #7330 from donaldsharp/zebra_use_after_free

zebra: Fix use after free in debug path

3 years agoMerge pull request #7306 from donaldsharp/bgp_dest_print
Donatas Abraitis [Sat, 17 Oct 2020 17:21:52 +0000 (20:21 +0300)]
Merge pull request #7306 from donaldsharp/bgp_dest_print

Bgp dest print

3 years agoMerge pull request #7322 from Orange-OpenSource/ospf-sr
Donald Sharp [Sat, 17 Oct 2020 17:17:50 +0000 (13:17 -0400)]
Merge pull request #7322 from Orange-OpenSource/ospf-sr

ospfd: Store neighbor Adjacency SID in SR database

3 years agoMerge pull request #7317 from pjdruddy/pr-fix-evpn-prefix2string
Donald Sharp [Sat, 17 Oct 2020 17:16:21 +0000 (13:16 -0400)]
Merge pull request #7317 from pjdruddy/pr-fix-evpn-prefix2string

Pr fix evpn prefix2string

3 years agozebra: Fix use after free in debug path
Donald Sharp [Fri, 16 Oct 2020 17:51:52 +0000 (13:51 -0400)]
zebra: Fix use after free in debug path

When zebra is running with debugs turned on there
is a use after free reported by the address sanitizer:

2020/10/16 12:58:02 ZEBRA: rib_delnode: (0:254):4.5.6.16/32: rn 0x60b000026f20, re 0x6080000131a0, removing
2020/10/16 12:58:02 ZEBRA: rib_meta_queue_add: (0:254):4.5.6.16/32: queued rn 0x60b000026f20 into sub-queue 3
=================================================================
==3101430==ERROR: AddressSanitizer: heap-use-after-free on address 0x608000011d28 at pc 0x555555705ab6 bp 0x7fffffffdab0 sp 0x7fffffffdaa8
READ of size 8 at 0x608000011d28 thread T0
    #0 0x555555705ab5 in re_list_const_first zebra/rib.h:222
    #1 0x555555705b54 in re_list_first zebra/rib.h:222
    #2 0x555555711a4f in process_subq_route zebra/zebra_rib.c:2248
    #3 0x555555711d2e in process_subq zebra/zebra_rib.c:2286
    #4 0x555555711ec7 in meta_queue_process zebra/zebra_rib.c:2320
    #5 0x7ffff74701f7 in work_queue_run lib/workqueue.c:291
    #6 0x7ffff7450e9c in thread_call lib/thread.c:1581
    #7 0x7ffff738eaf7 in frr_run lib/libfrr.c:1099
    #8 0x55555561a578 in main zebra/main.c:455
    #9 0x7ffff7079cc9 in __libc_start_main ../csu/libc-start.c:308
    #10 0x5555555e3429 in _start (/usr/lib/frr/zebra+0x8f429)
0x608000011d28 is located 8 bytes inside of 88-byte region [0x608000011d20,0x608000011d78)
freed by thread T0 here:
    #0 0x7ffff768bb6f in __interceptor_free (/lib/x86_64-linux-gnu/libasan.so.6+0xa9b6f)
    #1 0x7ffff739ccad in qfree lib/memory.c:129
    #2 0x555555709ee4 in rib_gc_dest zebra/zebra_rib.c:746
    #3 0x55555570ca76 in rib_process zebra/zebra_rib.c:1240
    #4 0x555555711a05 in process_subq_route zebra/zebra_rib.c:2245
    #5 0x555555711d2e in process_subq zebra/zebra_rib.c:2286
    #6 0x555555711ec7 in meta_queue_process zebra/zebra_rib.c:2320
    #7 0x7ffff74701f7 in work_queue_run lib/workqueue.c:291
    #8 0x7ffff7450e9c in thread_call lib/thread.c:1581
    #9 0x7ffff738eaf7 in frr_run lib/libfrr.c:1099
    #10 0x55555561a578 in main zebra/main.c:455
    #11 0x7ffff7079cc9 in __libc_start_main ../csu/libc-start.c:308
previously allocated by thread T0 here:
    #0 0x7ffff768c037 in calloc (/lib/x86_64-linux-gnu/libasan.so.6+0xaa037)
    #1 0x7ffff739cb98 in qcalloc lib/memory.c:110
    #2 0x555555712ace in zebra_rib_create_dest zebra/zebra_rib.c:2515
    #3 0x555555712c6c in rib_link zebra/zebra_rib.c:2576
    #4 0x555555712faa in rib_addnode zebra/zebra_rib.c:2607
    #5 0x555555715bf0 in rib_add_multipath_nhe zebra/zebra_rib.c:3012
    #6 0x555555715f56 in rib_add_multipath zebra/zebra_rib.c:3049
    #7 0x55555571788b in rib_add zebra/zebra_rib.c:3327
    #8 0x5555555e584a in connected_up zebra/connected.c:254
    #9 0x5555555e42ff in connected_announce zebra/connected.c:94
    #10 0x5555555e4fd3 in connected_update zebra/connected.c:195
    #11 0x5555555e61ad in connected_add_ipv4 zebra/connected.c:340
    #12 0x5555555f26f5 in netlink_interface_addr zebra/if_netlink.c:1213
    #13 0x55555560f756 in netlink_information_fetch zebra/kernel_netlink.c:350
    #14 0x555555612e49 in netlink_parse_info zebra/kernel_netlink.c:941
    #15 0x55555560f9f1 in kernel_read zebra/kernel_netlink.c:402
    #16 0x7ffff7450e9c in thread_call lib/thread.c:1581
    #17 0x7ffff738eaf7 in frr_run lib/libfrr.c:1099
    #18 0x55555561a578 in main zebra/main.c:455
    #19 0x7ffff7079cc9 in __libc_start_main ../csu/libc-start.c:308
SUMMARY: AddressSanitizer: heap-use-after-free zebra/rib.h:222 in re_list_const_first

This is happening because we are using the dest pointer after a call into
rib_gc_dest.  In process_subq_route, we call rib_process() and if the
dest is deleted dest pointer is now garbage.  We must reload the
dest pointer in this case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: Add %pBD print formatter to doc
Donald Sharp [Fri, 16 Oct 2020 11:44:26 +0000 (07:44 -0400)]
doc: Add %pBD print formatter to doc

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Use bgp_dest_get_prefix accessor function
Donald Sharp [Wed, 14 Oct 2020 15:39:27 +0000 (11:39 -0400)]
bgpd: Use bgp_dest_get_prefix accessor function

Use the appropriate bgp_dest_get_prefix accessor function

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: More bgp_node -> bgp_dest cleanup
Donald Sharp [Wed, 14 Oct 2020 15:19:45 +0000 (11:19 -0400)]
bgpd: More bgp_node -> bgp_dest cleanup

Some more of the bgp_node usage snuck in from big commits in
the past month or so from feature work.  Do some work
to put it back to bgp_dest for incoming future work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Convert to %pFX or %pBD where possible
Donald Sharp [Wed, 14 Oct 2020 15:07:57 +0000 (11:07 -0400)]
bgpd: Convert to %pFX or %pBD where possible

Search and destroy places where we used prefix2str
that could be replaced with %pFX or %pBD in bgpd.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: add `%pBD` for printing `struct bgp_dest *`
David Lamparter [Tue, 23 Jun 2020 14:00:41 +0000 (16:00 +0200)]
bgpd: add `%pBD` for printing `struct bgp_dest *`

`%pRN` is not appropriate anymore.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #7335 from opensourcerouting/fix-ti-lfa-topotest
Donald Sharp [Sat, 17 Oct 2020 12:07:17 +0000 (08:07 -0400)]
Merge pull request #7335 from opensourcerouting/fix-ti-lfa-topotest

tests: fix spurious failures in the TI-LFA topotest

3 years agosharpd: Fix nexthop group name collision
Donald Sharp [Sat, 17 Oct 2020 01:44:29 +0000 (21:44 -0400)]
sharpd: Fix nexthop group name collision

If you have two nexthop groups named
one
oneone

then the sharp daemon will treat them as the same nexthop
group.  This is because we are doign this:

static int sharp_nhg_compare_func(const struct sharp_nhg *a,
                                  const struct sharp_nhg *b)
{
        return strncmp(a->name, b->name, strlen(a->name));
}

The strlen should be the size of the array of name.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: fix spurious failures in the TI-LFA topotest
Renato Westphal [Fri, 16 Oct 2020 23:40:11 +0000 (20:40 -0300)]
tests: fix spurious failures in the TI-LFA topotest

Skip comparing neighbor-extended-circuit-id in yang output. They
are not consistent.

This is similar to commit ecc11c93b7eace which fixed the same
problem in the IS-IS SR topotest.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #7235 from opensourcerouting/acl-wildcard-fix
Santosh P K [Fri, 16 Oct 2020 15:58:39 +0000 (21:28 +0530)]
Merge pull request #7235 from opensourcerouting/acl-wildcard-fix

lib,yang: cisco acl network wildcard fixes

3 years agobgpd: replace bgp_evpn_route2str with prefix2str
Pat Ruddy [Thu, 15 Oct 2020 13:25:26 +0000 (14:25 +0100)]
bgpd: replace bgp_evpn_route2str with prefix2str

Remove bgp_evpn_route2str and replace calls with prefix2str

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7011 from opensourcerouting/isis-ti-lfa
Olivier Dugeon [Fri, 16 Oct 2020 10:04:37 +0000 (12:04 +0200)]
Merge pull request #7011 from opensourcerouting/isis-ti-lfa

isisd: add support for Topology Independent LFA (TI-LFA)

3 years agoMerge pull request #7290 from eololab/small-fix-for-frrcommon-in-tools
Quentin Young [Thu, 15 Oct 2020 19:53:42 +0000 (15:53 -0400)]
Merge pull request #7290 from eololab/small-fix-for-frrcommon-in-tools

tools: use function chownfrr everywhere

3 years agoMerge pull request #7320 from pjdruddy/pr-prefix-string
Quentin Young [Thu, 15 Oct 2020 18:30:47 +0000 (14:30 -0400)]
Merge pull request #7320 from pjdruddy/pr-prefix-string

vrrpd: Convert to using %pFX

3 years agovrrpd: Convert to using %pFX
Pat Ruddy [Thu, 15 Oct 2020 15:40:36 +0000 (16:40 +0100)]
vrrpd: Convert to using %pFX

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7304 from volta-networks/fix_vs_1811
Donald Sharp [Thu, 15 Oct 2020 15:17:10 +0000 (11:17 -0400)]
Merge pull request #7304 from volta-networks/fix_vs_1811

ospfd: fix invocation of ospfTrapNbrStateChange

3 years agolib: align prefixevpn2str output with bgp_evpn_route2str
Pat Ruddy [Thu, 15 Oct 2020 11:24:51 +0000 (12:24 +0100)]
lib: align prefixevpn2str output with bgp_evpn_route2str

We have 2 different routines to turn an evpn route into a string.
This commit aligns the two to the latest maintained version as a
first step in removing one of them.

Signed-off-by: Pat Ruddy <pat@voltanet.io>
3 years agoMerge pull request #7312 from idryzhov/fix-ip-router-isis
Donald Sharp [Thu, 15 Oct 2020 11:09:39 +0000 (07:09 -0400)]
Merge pull request #7312 from idryzhov/fix-ip-router-isis

isisd: fix check for area-tag modification

3 years agoospfd: fix invocation of ospfTrapNbrStateChange
Babis Chalios [Thu, 1 Oct 2020 09:07:54 +0000 (11:07 +0200)]
ospfd: fix invocation of ospfTrapNbrStateChange

ospfNbrStateChange is generated when the state of neighbor regresses or
it progresses to a terminal state. When transitioning to or from Full
state on non-broadcast multi-access and broadcast networks the trap
should be sent by the designated router. This last condition was not
taken into account when checking for the conditions of generating the
trap.

Fixes volta/volta-stack#1811

Signed-off-by: Babis Chalios <mail@bchalios.io>
3 years agoisisd: fix check for area-tag modification
Igor Ryzhov [Wed, 14 Oct 2020 20:01:49 +0000 (23:01 +0300)]
isisd: fix check for area-tag modification

Interface area-tag is not supposed to be modified once defined, but the
necessary check is currently broken, because the circuit is never in
init_circ_list if the area-tag is already configured for the interface.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #6016 from sarav511/ppend
Donald Sharp [Thu, 15 Oct 2020 00:27:17 +0000 (20:27 -0400)]
Merge pull request #6016 from sarav511/ppend

pimd: Handling prune received during join state and join received during prune pending

3 years agoMerge pull request #5895 from patrasar/2404618
Donald Sharp [Thu, 15 Oct 2020 00:13:31 +0000 (20:13 -0400)]
Merge pull request #5895 from patrasar/2404618

pimd: Clear (s,g,rpt) ifchannel on (*, G) prune received

3 years agoMerge pull request #7309 from mjstapp/fix_ospf_gr_reasons
Donald Sharp [Wed, 14 Oct 2020 23:19:39 +0000 (19:19 -0400)]
Merge pull request #7309 from mjstapp/fix_ospf_gr_reasons

ospfd: make GR reason string production safer

3 years agoMerge pull request #7308 from mjstapp/fix_ospf_gr_sa
Donald Sharp [Wed, 14 Oct 2020 23:18:24 +0000 (19:18 -0400)]
Merge pull request #7308 from mjstapp/fix_ospf_gr_sa

ospfd: fix SA warnings in ospfd, ospfclient

3 years agoMerge pull request #7310 from idryzhov/fix-no-bgp-as-path
Donald Sharp [Wed, 14 Oct 2020 23:15:49 +0000 (19:15 -0400)]
Merge pull request #7310 from idryzhov/fix-no-bgp-as-path

bgpd: print error when as-path filter doesn't exist

3 years agobgpd: print error when as-path filter doesn't exist
Igor Ryzhov [Wed, 14 Oct 2020 16:56:18 +0000 (19:56 +0300)]
bgpd: print error when as-path filter doesn't exist

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoisisd: change debug messages to use uppercase SPF
Renato Westphal [Sun, 20 Sep 2020 16:21:53 +0000 (13:21 -0300)]
isisd: change debug messages to use uppercase SPF

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agodoc: document new IS-IS TI-LFA commands and options
Renato Westphal [Mon, 31 Aug 2020 18:10:50 +0000 (15:10 -0300)]
doc: document new IS-IS TI-LFA commands and options

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agotests: add IS-IS TI-LFA topotest
Renato Westphal [Thu, 20 Aug 2020 22:53:47 +0000 (19:53 -0300)]
tests: add IS-IS TI-LFA topotest

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agotests: add IS-IS TI-LFA unit tests
Renato Westphal [Mon, 31 Aug 2020 17:18:58 +0000 (14:18 -0300)]
tests: add IS-IS TI-LFA unit tests

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: implement TI-LFA protection for Adj-SIDs
Renato Westphal [Mon, 31 Aug 2020 18:24:02 +0000 (15:24 -0300)]
isisd: implement TI-LFA protection for Adj-SIDs

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoisisd: add support for Topology Independent LFA (TI-LFA)
Renato Westphal [Thu, 20 Aug 2020 22:55:42 +0000 (19:55 -0300)]
isisd: add support for Topology Independent LFA (TI-LFA)

TI-LFA is a modern fast-reroute (FRR) solution that leverages Segment
Routing to pre-compute backup nexthops for all destinations in the
network, helping to reduce traffic restoration times whenever a
failure occurs. The backup nexthops are expected to be installed
in the FIB so that they can be activated as soon as a failure
is detected, making sub-50ms recovery possible (assuming an
hierarchical FIB).

TI-LFA is a huge step forward compared to prior IP-FRR solutions,
like classic LFA and Remote LFA, as it guarantees 100% coverage
for all destinations. This is possible thanks to the source routing
capabilities of SR, which allows the backup nexthops to steer traffic
around the failures (using as many SIDs as necessary). In addition
to that, the repair paths always follow the post-convergence SPF
tree, which prevents transient congestions and suboptimal routing
from happening.

Deploying TI-LFA is very simple as it only requires a single
configuration command for each interface that needs to be protected
(both link protection and node protection are available). In addition
to IPv4 and IPv6 routes, SR Prefix-SIDs and Adj-SIDs are also
protected by the backup nexthops computed by the TI-LFA algorithms.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoyang, isisd: add TI-LFA YANG nodes and corresponding skeleton callbacks
Renato Westphal [Mon, 31 Aug 2020 18:34:06 +0000 (15:34 -0300)]
yang, isisd: add TI-LFA YANG nodes and corresponding skeleton callbacks

Add CLI wrapper commands as well...

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix SA warnings in ospfd, ospfclient
Mark Stapp [Wed, 14 Oct 2020 16:30:01 +0000 (12:30 -0400)]
ospfd: fix SA warnings in ospfd, ospfclient

Fix some SA warnings in ospf GR and ospfclient code.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoospfd: make reason string production safer
Mark Stapp [Wed, 14 Oct 2020 16:51:52 +0000 (12:51 -0400)]
ospfd: make reason string production safer

Use to-string functions for GR message codes instead of raw
string array indexing; the values used can come in packets
and are not validated.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7180 from kuldeepkash/bgp-communities
Donald Sharp [Wed, 14 Oct 2020 13:14:10 +0000 (09:14 -0400)]
Merge pull request #7180 from kuldeepkash/bgp-communities

tests: Add bgp_communities_topo1 test suite

3 years agoMerge pull request #7244 from donaldsharp/mlag_backout_and_fix
Mark Stapp [Wed, 14 Oct 2020 12:30:54 +0000 (08:30 -0400)]
Merge pull request #7244 from donaldsharp/mlag_backout_and_fix

Mlag backout and fix

3 years agoospfd: Store neighbor Adjacency SID in SR database
Olivier Dugeon [Wed, 14 Oct 2020 12:17:58 +0000 (14:17 +0200)]
ospfd: Store neighbor Adjacency SID in SR database

For TI-LFA, it is necessay to known the Adjacency SID advetise by the nieghbor
routers. However, the current Segment Routing code skip neighbor Adjacency SID
and thus, don't store them into the Segment Routing database.

This PR takes care of neighbor Adjacency SID by allowing to store them in the
Segment Routing database. Corresponding MPLS table entry is only configured if
the advertised Adjacency SID is global i.e. with L-Flag unset.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
3 years agoMerge pull request #7283 from donaldsharp/thread_off_semantics
Donatas Abraitis [Wed, 14 Oct 2020 11:50:08 +0000 (14:50 +0300)]
Merge pull request #7283 from donaldsharp/thread_off_semantics

*: Use proper semantics for turning off thread

3 years agoMerge pull request #7298 from mjstapp/quiet_opaque_debugs
Donald Sharp [Wed, 14 Oct 2020 11:27:27 +0000 (07:27 -0400)]
Merge pull request #7298 from mjstapp/quiet_opaque_debugs

zebra: quiet the zebra opaque message debugs

3 years agoMerge pull request #7278 from donaldsharp/fix_blame_code
Donatas Abraitis [Wed, 14 Oct 2020 06:21:50 +0000 (09:21 +0300)]
Merge pull request #7278 from donaldsharp/fix_blame_code

*: Consolidate on first git blame ignore revs

3 years ago*: Consolidate on first git blame ignore revs
Donald Sharp [Sun, 11 Oct 2020 15:21:33 +0000 (11:21 -0400)]
*: Consolidate on first git blame ignore revs

The file .git-blame-ignore-revs was put first into
the system and is what was advertised in multiple
places.  Since .ignore-revs was just created and
no announcement was made about the creation, let's
consolidate onto the first one created.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Isolate mlag_rd_buf_offset to the actual using function
Donald Sharp [Mon, 5 Oct 2020 16:24:10 +0000 (12:24 -0400)]
zebra: Isolate mlag_rd_buf_offset to the actual using function

Isolate the mlag_rd_buf_offset variable to the actual used function,
instead of having it a global.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoRevert "zebra: the mlag_rd_buf_offset variable was write only"
Donald Sharp [Mon, 5 Oct 2020 16:19:41 +0000 (12:19 -0400)]
Revert "zebra: the mlag_rd_buf_offset variable was write only"

This reverts commit 00e0d113e5ffcb69304b8d5d83f0357ec416c6c4.

3 years agoMerge pull request #7258 from mjstapp/zebra_remove_slsp
Donald Sharp [Tue, 13 Oct 2020 19:51:18 +0000 (15:51 -0400)]
Merge pull request #7258 from mjstapp/zebra_remove_slsp

zebra: remove 'static' lsp objects

3 years agoMerge pull request #7295 from donaldsharp/ospf_crash
Jafar Al-Gharaibeh [Tue, 13 Oct 2020 18:27:55 +0000 (13:27 -0500)]
Merge pull request #7295 from donaldsharp/ospf_crash

ospfd: Prevent crash if transferring config amongst instances

3 years agoMerge pull request #7245 from donaldsharp/ospf_coverity
Jafar Al-Gharaibeh [Tue, 13 Oct 2020 18:26:47 +0000 (13:26 -0500)]
Merge pull request #7245 from donaldsharp/ospf_coverity

ospfclient: Provide some protection against blindly trusting input

3 years agozebra: quiet the zebra opaque message debugs
Mark Stapp [Tue, 13 Oct 2020 17:50:55 +0000 (13:50 -0400)]
zebra: quiet the zebra opaque message debugs

Put most of the debugs about opaque ZAPI messages under 'detail'
to reduce the noise.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
3 years agoMerge pull request #7282 from zpericic/nhrp-vici
Jafar Al-Gharaibeh [Tue, 13 Oct 2020 18:04:15 +0000 (13:04 -0500)]
Merge pull request #7282 from zpericic/nhrp-vici

nhrp: Configure vici socket path using configure --with-vici-socket=/…

3 years agoMerge pull request #7288 from rsmarples/BSD-link_state
Donald Sharp [Tue, 13 Oct 2020 17:43:07 +0000 (13:43 -0400)]
Merge pull request #7288 from rsmarples/BSD-link_state

BSD: ifi_link_state is the link state

3 years agoMerge pull request #7294 from idryzhov/fix-no-ip-ospf-area
Donald Sharp [Tue, 13 Oct 2020 17:37:03 +0000 (13:37 -0400)]
Merge pull request #7294 from idryzhov/fix-no-ip-ospf-area

ospfd: fix "no ip ospf area"

3 years agoMerge pull request #7179 from kuldeepkash/bgp_basic_functionality
Donald Sharp [Tue, 13 Oct 2020 17:33:58 +0000 (13:33 -0400)]
Merge pull request #7179 from kuldeepkash/bgp_basic_functionality

tests: Enable evpn_type5_test_topo1 suite to run in CI

3 years agotests: Enable evpn_type5_test_topo1 suite to run in CI
Kuldeep Kashyap [Fri, 25 Sep 2020 03:10:01 +0000 (03:10 +0000)]
tests: Enable evpn_type5_test_topo1 suite to run in CI

1. Suite: evpn_type5_test_topo1 was added to pytest.ini during triaging phase as
there was bug: https://github.com/FRRouting/frr/issues/6867, which is fixed. Enabling
suite to be run in CI.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agoMerge pull request #7293 from eololab/remove-remaining-keep-kernel-option
Donald Sharp [Tue, 13 Oct 2020 14:52:09 +0000 (10:52 -0400)]
Merge pull request #7293 from eololab/remove-remaining-keep-kernel-option

doc, zebra: remove keep_kernel option everywhere

3 years agoospfd: Prevent crash if transferring config amongst instances
Donald Sharp [Tue, 13 Oct 2020 12:16:15 +0000 (08:16 -0400)]
ospfd: Prevent crash if transferring config amongst instances

If we enter:

int eth0
  ip ospf area 0
  ip ospf 10 area 0
!

This will crash ospf.  Prevent this from happening.

OSPF instances:

a) Cannot be mixed with non-instance
b) Are their own process.

Since in multi-instance world ospf instances are their own process,
when an ospf processes receives an instance command we must remove
our config( if present ) and allow the new config to be active
in the new process.  The problem here is that if you have not
done a `router ospf` above the lookup of the ospf pointer will
fail and we will just crash.  Put some code in to prevent a crash
in this case.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: fix "no ip ospf area"
Igor Ryzhov [Tue, 13 Oct 2020 11:03:42 +0000 (14:03 +0300)]
ospfd: fix "no ip ospf area"

This commit fixes the following behavior:
```
nfware(config)# interface enp2s0
nfware(config-if)# ip ospf area 0
nfware(config-if)# no ip ospf area 0
% [ospfd]: command ignored as it targets an instance that is not running
```

We should be able to use the command without configuring the instance.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc, zebra: remove keep_kernel option everywhere
Emanuele Bovisio [Wed, 7 Oct 2020 15:27:27 +0000 (17:27 +0200)]
doc, zebra: remove keep_kernel option everywhere

remove all remaining parts related to keep_kernel option

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
3 years agoMerge pull request #7279 from donaldsharp/17_coverity
Patrick Ruddy [Tue, 13 Oct 2020 10:48:37 +0000 (11:48 +0100)]
Merge pull request #7279 from donaldsharp/17_coverity

17 coverity

3 years agozebra: ifi_link_state is the link state
Roy Marples [Mon, 12 Oct 2020 19:53:14 +0000 (20:53 +0100)]
zebra: ifi_link_state is the link state

SIOCGIFMEDIA returns the media state.
SIOCGIFDATA returns interface data which includes the link state.

While the status of the former is usually indicitive of the latter,
this is not always the case.
Ifact some recent net80211 changes in at least NetBSD and OpenBSD
have MONITOR media set to active but the link status set to DOWN.

All interfaces will return link state with SIOCGIFDATA, unlike
SIOCGIFMEDIA. However not all BSD's support SIOCGIFDATA - it has
recently been accepted into FreeBSD-13.
However, all BSD's do report the same structure in ifa_data for
AF_LINK addresses from getifaddrs(3) so the information has always
been available.

Signed-off-by: Roy Marples <roy@marples.name>
3 years agoMerge pull request #7277 from chiragshah6/yang_nb6
Donatas Abraitis [Tue, 13 Oct 2020 08:12:28 +0000 (11:12 +0300)]
Merge pull request #7277 from chiragshah6/yang_nb6

 bgpd: fix crash in bgp instance creation

3 years agotools: use function chownfrr
Emanuele Bovisio [Wed, 7 Oct 2020 13:52:50 +0000 (15:52 +0200)]
tools: use function chownfrr

chownfrr applies correct owner and group

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
3 years agoMerge pull request #7287 from taspelund/ipv4-lu-show-routes
Donatas Abraitis [Tue, 13 Oct 2020 06:44:50 +0000 (09:44 +0300)]
Merge pull request #7287 from taspelund/ipv4-lu-show-routes

bgpd: fix show bgp neighbor routes for labeled-unicast

3 years agotests: Add bgp_communities_topo1 test suite
Kuldeep Kashyap [Fri, 25 Sep 2020 09:55:08 +0000 (09:55 +0000)]
tests: Add bgp_communities_topo1 test suite

1. Adding test to verify well known communities: no-export, local-AS, internet
2. Exection time is 90 sec

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
3 years agobgpd: use common api in bgp_get
Chirag Shah [Mon, 12 Oct 2020 23:11:58 +0000 (16:11 -0700)]
bgpd: use common api in bgp_get

Use consolidate api in bgp_get and bgp northbound
create callback.

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agobgpd: fix crash in bgp instance creation
Chirag Shah [Sat, 10 Oct 2020 22:09:11 +0000 (15:09 -0700)]
bgpd: fix crash in bgp instance creation

In bgp global commands northbound local-as modify callback
check for backend db for checking existing bgp instance.

In an instance where no router bgp with old ASN cleaned up
followed by new bgp instance with new AS is created,
the nb_running_get_entry in validation phase returns stale
bgp reference, which leads to rejection of the router bgp command.

Uncovered via:
toptotest evpn_type5_test_topo1/test_evpn_type5_topo1.py
test_bgp_attributes_for_evpn_address_family_p1

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agobgpd: rename router bgp callbacks
Chirag Shah [Sat, 10 Oct 2020 21:26:48 +0000 (14:26 -0700)]
bgpd: rename router bgp callbacks

Avoid similar name function as bgp_crate()

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agobgpd: fix show bgp neighbor routes for labeled-unicast
Trey Aspelund [Mon, 12 Oct 2020 19:39:11 +0000 (15:39 -0400)]
bgpd: fix show bgp neighbor routes for labeled-unicast

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>
3 years agoMerge pull request #7251 from wesleycoakley/fix-vtysh-node-build-warn-errors
Donatas Abraitis [Mon, 12 Oct 2020 18:31:04 +0000 (21:31 +0300)]
Merge pull request #7251 from wesleycoakley/fix-vtysh-node-build-warn-errors

vtysh: fix build-time errors for some --enable flags

3 years agoMerge pull request #7284 from donaldsharp/pmax
Donatas Abraitis [Mon, 12 Oct 2020 18:07:08 +0000 (21:07 +0300)]
Merge pull request #7284 from donaldsharp/pmax

bgpd: Correctly calculate threshold being reached

3 years agonhrp: Make vici socket path configurable
Zoran Pericic [Sat, 25 Jan 2020 18:38:39 +0000 (19:38 +0100)]
nhrp: Make vici socket path configurable

nhrp: Configure vici socket path using

configure --with-vici-socket=/var/run/charon.vici

If not specified default to /var/run/charon.vici

Signed-off-by: Zoran Peričić <zpericic@netst.org>
3 years agobgpd: Correctly calculate threshold being reached
Donald Sharp [Mon, 12 Oct 2020 14:36:37 +0000 (10:36 -0400)]
bgpd: Correctly calculate threshold being reached

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>
3 years agoMerge pull request #6811 from rgirada/test_helper
Russ White [Mon, 12 Oct 2020 14:16:27 +0000 (10:16 -0400)]
Merge pull request #6811 from rgirada/test_helper

ospfd: ospfv2 graceful restart helper support.

3 years ago*: Use proper semantics for turning off thread
Donald Sharp [Mon, 12 Oct 2020 12:35:18 +0000 (08:35 -0400)]
*: Use proper semantics for turning off thread

We have this pattern in the code base:

if (thread)
THREAD_OFF(thread);

If we look at THREAD_OFF we check to see if thread
is non-null too.  So we have a double check.
This is unnecessary.  Convert to just using THREAD_OFF

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #6927 from donaldsharp/16_coverity
Olivier Dugeon [Mon, 12 Oct 2020 07:22:46 +0000 (09:22 +0200)]
Merge pull request #6927 from donaldsharp/16_coverity

Cleanup a bunch of new coverity issues

3 years agoospfd: When failing to set socket options just note the failure
Donald Sharp [Sun, 11 Oct 2020 16:56:02 +0000 (12:56 -0400)]
ospfd: When failing to set socket options just note the failure

Instead of closing the socket, just note the failure and
continue on.  If we actually failed here so many other
things would not be working at all, that actually
closing the fd won't matter.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoripngd: Intentionally ignore return code for str2prefix_ipv6
Donald Sharp [Sun, 11 Oct 2020 16:38:42 +0000 (12:38 -0400)]
ripngd: Intentionally ignore return code for str2prefix_ipv6

We are calling str2prefix_ipv6 for a default route.  Since
we know this will always succeed we can safely tell the compiler
that we are ok ignoring the return code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d, tests: Prevent use after free
Donald Sharp [Mon, 17 Aug 2020 12:25:12 +0000 (08:25 -0400)]
ospf6d, tests: Prevent use after free

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>
3 years agoospf6d: Make ospf6_lsa_lock follow normal FRR pattern
Donald Sharp [Sun, 11 Oct 2020 15:13:33 +0000 (11:13 -0400)]
ospf6d: Make ospf6_lsa_lock follow normal FRR pattern

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>
3 years agozebra: zevpn cannot be null passed into zebra_evpn_es_evi_show_one_evpn
Donald Sharp [Sat, 15 Aug 2020 17:41:18 +0000 (13:41 -0400)]
zebra: zevpn cannot be null passed into zebra_evpn_es_evi_show_one_evpn

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>
3 years agozebra: n->mac is derefed in all paths
Donald Sharp [Sat, 15 Aug 2020 17:37:09 +0000 (13:37 -0400)]
zebra: n->mac is derefed in all paths

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>
3 years agoMerge pull request #7222 from idryzhov/fix-debug
Renato Westphal [Sat, 10 Oct 2020 00:58:24 +0000 (21:58 -0300)]
Merge pull request #7222 from idryzhov/fix-debug

fix debug commands node inconsistencies

3 years agoMerge pull request #7270 from donaldsharp/isis_cleanup
Renato Westphal [Sat, 10 Oct 2020 00:53:06 +0000 (21:53 -0300)]
Merge pull request #7270 from donaldsharp/isis_cleanup

Isis cleanup

3 years agoMerge pull request #7269 from idryzhov/rip-crash-fix
Donald Sharp [Fri, 9 Oct 2020 23:38:07 +0000 (19:38 -0400)]
Merge pull request #7269 from idryzhov/rip-crash-fix

rip(ng)d: fix interfaces cleaning (leads to crash #6477)

3 years agoMerge pull request #7268 from ton31337/fix/dead_name_bgpd
Donald Sharp [Fri, 9 Oct 2020 23:34:38 +0000 (19:34 -0400)]
Merge pull request #7268 from ton31337/fix/dead_name_bgpd

bgpd: Use default VRF name if using `router bgp` command

3 years agoMerge pull request #7271 from vishaldhingra/static
Donald Sharp [Fri, 9 Oct 2020 23:29:55 +0000 (19:29 -0400)]
Merge pull request #7271 from vishaldhingra/static

staticd: To set the default value of blackhole type correctly

3 years agoMerge pull request #7265 from qlyoung/doc-black
Mark Stapp [Fri, 9 Oct 2020 18:02:52 +0000 (14:02 -0400)]
Merge pull request #7265 from qlyoung/doc-black

doc: document use of black for python formatting

3 years agostaticd: To set the default value of blackhole type correctly
vdhingra [Fri, 9 Oct 2020 16:23:14 +0000 (09:23 -0700)]
staticd: To set the default value of blackhole type correctly

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>
3 years agoospfclient: Provide some protection against blindly trusting input
Donald Sharp [Mon, 5 Oct 2020 20:19:09 +0000 (16:19 -0400)]
ospfclient: Provide some protection against blindly trusting input

Coverity rightly points out that blindly trusting the lsalen
from received data may not be the smartest thing to do.  Add
a bit of code to prevent us from blindly malloc'ing
too much memory.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: circuit->area->isis to circuit->isis
Donald Sharp [Fri, 9 Oct 2020 12:00:44 +0000 (08:00 -0400)]
isisd: circuit->area->isis to circuit->isis

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>