]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoMerge pull request #9693 from donaldsharp/bgp_address_removal
Donatas Abraitis [Fri, 8 Oct 2021 14:41:59 +0000 (17:41 +0300)]
Merge pull request #9693 from donaldsharp/bgp_address_removal

bgpd: When removing v6 address being used as a nexthop ensure peer is…

2 years agoMerge pull request #9727 from ton31337/feature/catch_struct_thread_xxx_against_NULL_c...
Igor Ryzhov [Fri, 8 Oct 2021 08:40:07 +0000 (11:40 +0300)]
Merge pull request #9727 from ton31337/feature/catch_struct_thread_xxx_against_NULL_coccinelle

bgpd: Don't set NULL for struct thread at bgp_dump_interval_func()

2 years agoMerge pull request #9773 from idryzhov/bgp-show-prefix-filter-vrf
Donatas Abraitis [Fri, 8 Oct 2021 05:52:37 +0000 (08:52 +0300)]
Merge pull request #9773 from idryzhov/bgp-show-prefix-filter-vrf

bgpd: add missing vrf/view parameter to one command

2 years agoMerge pull request #9756 from donaldsharp/unchecked
Igor Ryzhov [Thu, 7 Oct 2021 22:08:03 +0000 (01:08 +0300)]
Merge pull request #9756 from donaldsharp/unchecked

2 years agoMerge pull request #9737 from idryzhov/yang-pattern
Quentin Young [Thu, 7 Oct 2021 18:29:07 +0000 (14:29 -0400)]
Merge pull request #9737 from idryzhov/yang-pattern

2 years agoMerge pull request #9735 from donaldsharp/watchfrr_netns
Igor Ryzhov [Thu, 7 Oct 2021 15:39:51 +0000 (18:39 +0300)]
Merge pull request #9735 from donaldsharp/watchfrr_netns

watchfrr: Allow an integrated config to work within a namespace

2 years agoMerge pull request #9740 from caracall/forked-upstream/debug_ospf6
Igor Ryzhov [Thu, 7 Oct 2021 15:38:22 +0000 (18:38 +0300)]
Merge pull request #9740 from caracall/forked-upstream/debug_ospf6

ospf6: add the ability of specifying router-id/area-id in no debug ospf6

2 years agobgpd: add missing vrf/view parameter to one command
Igor Ryzhov [Thu, 7 Oct 2021 15:29:22 +0000 (18:29 +0300)]
bgpd: add missing vrf/view parameter to one command

"show bgp neighbors PEER received prefix-filter" misses the argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #9345 from mjstapp/fix_lib_zmq_free
David Lamparter [Thu, 7 Oct 2021 13:20:19 +0000 (15:20 +0200)]
Merge pull request #9345 from mjstapp/fix_lib_zmq_free

2 years agoMerge pull request #9758 from idryzhov/resolver-thread
Donatas Abraitis [Thu, 7 Oct 2021 11:31:25 +0000 (14:31 +0300)]
Merge pull request #9758 from idryzhov/resolver-thread

lib: fix incorrect thread management

2 years agoMerge pull request #9698 from idryzhov/cleanup-loopback-or-vrf
Russ White [Wed, 6 Oct 2021 23:01:52 +0000 (19:01 -0400)]
Merge pull request #9698 from idryzhov/cleanup-loopback-or-vrf

*: cleanup interface loopback/vrf check

2 years agoMerge pull request #9699 from manojvn/379032-dev
Russ White [Wed, 6 Oct 2021 23:00:39 +0000 (19:00 -0400)]
Merge pull request #9699 from manojvn/379032-dev

ospf6d: minor struct compare issues.

2 years agoMerge pull request #9738 from rgirada/ospfv3_crash
Russ White [Wed, 6 Oct 2021 22:58:09 +0000 (18:58 -0400)]
Merge pull request #9738 from rgirada/ospfv3_crash

ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.

3 years agowatchfrr: Allow an integrated config to work within a namespace
Donald Sharp [Tue, 5 Oct 2021 00:32:25 +0000 (20:32 -0400)]
watchfrr: Allow an integrated config to work within a namespace

Since watchfrr invokes vtysh to gather the show run output and
write the data, if we are operating inside of a namespace FRR
must also pass this in.

Yes. This seems hacky.  I don't fully understand why vtysh
is invoked this way.

New output:

sharpd@eva:~/frr3$ sudo vtysh -N one

Hello, this is FRRouting (version 8.1-dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.

eva# wr mem
Note: this version of vtysh never writes vtysh.conf
% Can't open configuration file /etc/frr/one/vtysh.conf due to 'No such file or directory'.
Building Configuration...
Integrated configuration saved to /etc/frr/one/frr.conf
[OK]
eva#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobuild: bump configure.ac to `8.2-dev`
David Lamparter [Wed, 6 Oct 2021 16:18:17 +0000 (18:18 +0200)]
build: bump configure.ac to `8.2-dev`

[needs to happen ASAP to make sure we're not building confusing
packages.]

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: fix incorrect thread management
Igor Ryzhov [Wed, 6 Oct 2021 14:35:07 +0000 (17:35 +0300)]
lib: fix incorrect thread management

The current code passes an address of a local variable to `thread_add_read`
which stores it into `thread->ref` by the lib. The next time the thread
callback is executed, the lib stores NULL into the `thread->ref` which
means it writes into some random memory on the stack.

To fix this, we should pass a pointer to the vector entry to the lib.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: code cleanup.
Manoj Naragund [Thu, 30 Sep 2021 17:28:11 +0000 (10:28 -0700)]
ospf6d: code cleanup.

removal of some of the deadcode in ospf6d.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
3 years agoMerge pull request #9755 from pguibert6WIND/isis_sr_doc
Renato Westphal [Wed, 6 Oct 2021 15:13:26 +0000 (12:13 -0300)]
Merge pull request #9755 from pguibert6WIND/isis_sr_doc

doc: fix show isis route prefix-sid command

3 years agoospf6: add the ability of specifying router-id/area-id in no debug ospf6
Ahmad Caracalli [Wed, 6 Oct 2021 13:46:19 +0000 (15:46 +0200)]
ospf6: add the ability of specifying router-id/area-id in no debug ospf6

Add the ability to specify the router-id/area-id when deleting the debug
ospf6 configuration.

The new commands are as follow:

no debug ospf6 border-routers router-id [A.B.C.D]
no debug ospf6 border-routers area-id [A.B.C.D]

Update the doc as well.

Signed-off-by: Ahmad Caracalli <ahmad.caracalli@6wind.com>
3 years agobgpd: Check return code for bgp_route_match_add
Donald Sharp [Wed, 6 Oct 2021 12:01:30 +0000 (08:01 -0400)]
bgpd: Check return code for bgp_route_match_add

FRR uses bgp_route_match_add and checked the return
code in every place but one.  Fix so that the
return code is looked at and warned against

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Check return from generic_set_add
Donald Sharp [Wed, 6 Oct 2021 11:58:35 +0000 (07:58 -0400)]
bgpd: Check return from generic_set_add

Coverity found a couple of spots where FRR was
ignoring the return code of generic_set_add.
Just follow the code pattern for the rest of
the usage in the code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: fix show isis route prefix-sid command
Philippe Guibert [Wed, 6 Oct 2021 08:37:59 +0000 (10:37 +0200)]
doc: fix show isis route prefix-sid command

This command was not documented, and deprecates the old one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoMerge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv
Donald Sharp [Wed, 6 Oct 2021 10:40:36 +0000 (06:40 -0400)]
Merge pull request #9745 from opensourcerouting/bfd-ospf-topo-improv

topotests: improve bfd_ospf_topo1 test

3 years agoMerge pull request #9734 from donaldsharp/interface_startup
Renato Westphal [Wed, 6 Oct 2021 04:03:08 +0000 (01:03 -0300)]
Merge pull request #9734 from donaldsharp/interface_startup

Interface startup

3 years agoMerge pull request #9724 from idryzhov/isis-unused-func
Renato Westphal [Wed, 6 Oct 2021 03:58:47 +0000 (00:58 -0300)]
Merge pull request #9724 from idryzhov/isis-unused-func

isisd: remove unused function declaration

3 years agoMerge pull request #9716 from rgirada/ospf_gr_nbr
Russ White [Tue, 5 Oct 2021 23:28:40 +0000 (19:28 -0400)]
Merge pull request #9716 from rgirada/ospf_gr_nbr

ospfd: GR helper functionality change in helper exit

3 years agoMerge pull request #9731 from ton31337/fix/thread_null_set
Russ White [Tue, 5 Oct 2021 23:27:23 +0000 (19:27 -0400)]
Merge pull request #9731 from ton31337/fix/thread_null_set

cleanup: struct thread = NULL

3 years agoMerge pull request #9728 from donaldsharp/null_thread
Russ White [Tue, 5 Oct 2021 23:26:00 +0000 (19:26 -0400)]
Merge pull request #9728 from donaldsharp/null_thread

Null thread

3 years agoMerge pull request #9733 from opensourcerouting/grpc-fix-missing
Russ White [Tue, 5 Oct 2021 23:24:34 +0000 (19:24 -0400)]
Merge pull request #9733 from opensourcerouting/grpc-fix-missing

lib: fix gRPC crash on missing YANG node

3 years agoMerge pull request #9743 from pguibert6WIND/largecomm
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:30:45 +0000 (14:30 -0500)]
Merge pull request #9743 from pguibert6WIND/largecomm

bgpd: large community exact match fix

3 years agoMerge pull request #9711 from idryzhov/doc-ospf
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:25:42 +0000 (14:25 -0500)]
Merge pull request #9711 from idryzhov/doc-ospf

doc: fix ospf distribute-list command and description

3 years agoMerge pull request #9744 from idryzhov/isis-redist-cli
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 19:22:27 +0000 (14:22 -0500)]
Merge pull request #9744 from idryzhov/isis-redist-cli

isisd: fix redistribute CLI

3 years agoMerge pull request #9725 from idryzhov/doc-debug-ospf
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 16:52:32 +0000 (11:52 -0500)]
Merge pull request #9725 from idryzhov/doc-debug-ospf

doc: fix debugging-ospf label

3 years agoMerge pull request #9736 from ewlumpkin/comment_spelling_fixes
Jafar Al-Gharaibeh [Tue, 5 Oct 2021 16:48:20 +0000 (11:48 -0500)]
Merge pull request #9736 from ewlumpkin/comment_spelling_fixes

lib: fix spelling nits in command.h

3 years agotopotests: justify code sleep
Rafael Zalamena [Tue, 5 Oct 2021 15:37:34 +0000 (12:37 -0300)]
topotests: justify code sleep

Document the `sleep` statement so people know that we are sleeping
because we are waiting for the BFD down notification. If we don't
sleep here it is possible that we get outdated `show` command results.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: decrease result check frequency
Rafael Zalamena [Tue, 5 Oct 2021 15:36:43 +0000 (12:36 -0300)]
topotests: decrease result check frequency

Call the `show` commands less often to reduce the CPU pressure.

Also increase the wait time from 60 to 80 seconds to have spare room
for failures (4 times more). This is the latest measure wait time:

> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: increase OSPF convergence speed
Rafael Zalamena [Tue, 5 Oct 2021 15:35:42 +0000 (12:35 -0300)]
topotests: increase OSPF convergence speed

Reduce timers so we send hello packets more often and reduce dead
interval to converge faster.

Previous test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 47.20 seconds

New test wait amount:
> INFO: topolog: 'router_json_cmp' succeeded after 20.08 seconds

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoisisd: fix redistribute CLI
Igor Ryzhov [Tue, 5 Oct 2021 14:38:21 +0000 (17:38 +0300)]
isisd: fix redistribute CLI

Currently, it is possible to configure IPv6 protocols for IPv4
redistribution and vice versa in CLI. The YANG model doesn't allow this
so the user receives the following error:
```
nfware(config-router)# redistribute ipv4 ospf6 level-1
% Failed to edit configuration.

YANG error(s):
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 Invalid enumeration value "ospf6".
 YANG path: Schema location /frr-isisd:isis/instance/redistribute/ipv4/protocol.
```

Let's make CLI more user-friendly and allow only supported protocols in
redistribution commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: large community exact match fix
Philippe Guibert [Tue, 5 Oct 2021 14:24:41 +0000 (16:24 +0200)]
bgpd: large community exact match fix

The pointer to large community was not the appropriate one.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agolib: prevent gRPC assert on missing YANG node
Rafael Zalamena [Mon, 4 Oct 2021 21:10:58 +0000 (18:10 -0300)]
lib: prevent gRPC assert on missing YANG node

`yang_dnode_get` will `assert` if no YANG node/model exist, so lets test for
its existence first before trying to access it.

This `assert` is only acceptable for internal FRR usage otherwise we
might miss typos or unmatching YANG models nodes/leaves. For gRPC usage
we should let users attempt to use non existing models without
`assert`ing.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.
rgirada [Tue, 5 Oct 2021 07:52:36 +0000 (00:52 -0700)]
ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA.

Description:
When grace lsa received, DUT is adding
the copy of the  lsas  to all nbrs retransmission  list as part of
flooding procedure and subsequently incrementing the rmt counter in
the original the LSA. This counter is supposed to be decremented
when ack is received by nbr and the lsa  will be removed from retransmission list.

But in our current scenario,
Step-1:
When GR helper is disabled, if DUT receives the grace lsa
it adds the lsa copy to nbrs retransmission list but original
LSA will be discarded since GR helper disabled.
Step-2:
GR helper enabled and DUT receives the grace lsa, as part
of flooding process all nbrs have same copy of lsa in their
corresponding rmt list which was added in step -1 due to this
the corresponding rmt counter in the original lsa is not getting
incremented.
Step-3:
If the same copy of the grace lsa received by DUT, It considers
as implicit ack from nbr if the same copy of the lsa exits in its
rmt list and subsequently  decrement the rmt counter.
Since counter is zero (because of step-1 and 2) , it is asserting while decrement.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agoyang: replace an empty pattern with a zero-length restriction
Igor Ryzhov [Tue, 5 Oct 2021 10:27:39 +0000 (13:27 +0300)]
yang: replace an empty pattern with a zero-length restriction

No functional difference, but `length "0"` is more comprehensible.

Suggested-by: Christian Hopps <chopps@labn.net>
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix spelling nits in command.h
ewlumpkin [Tue, 5 Oct 2021 03:05:42 +0000 (03:05 +0000)]
lib: fix spelling nits in command.h

Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
3 years agozebra: Use a bool for startup indications
Donald Sharp [Tue, 5 Oct 2021 00:26:38 +0000 (20:26 -0400)]
zebra: Use a bool for startup indications

Let's not pass around an int startup when all we are doing
is true/falsing it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9726 from donaldsharp/ospf6_expire
Renato Westphal [Tue, 5 Oct 2021 00:13:50 +0000 (21:13 -0300)]
Merge pull request #9726 from donaldsharp/ospf6_expire

ospf6d: Ensure expire thread is properly stopped

3 years agozebra: On interface startup note that we are in startup
Donald Sharp [Mon, 4 Oct 2021 20:00:27 +0000 (16:00 -0400)]
zebra: On interface startup note that we are in startup

The boolean to notice that we are in startup situations
was not being properly set in one spot.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9722 from chiragshah6/zdev
Sri Mohana Singamsetty [Mon, 4 Oct 2021 17:07:00 +0000 (10:07 -0700)]
Merge pull request #9722 from chiragshah6/zdev

zebra: add nhg id to show ip route json

3 years agotools: Add coccinelle script to catch thread to NULL assignments
Donatas Abraitis [Mon, 4 Oct 2021 16:27:27 +0000 (19:27 +0300)]
tools: Add coccinelle script to catch thread to NULL assignments

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agowatchfrr: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:55 +0000 (19:26 +0300)]
watchfrr: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:39 +0000 (19:26 +0300)]
tests: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agopimd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:20 +0000 (19:26 +0300)]
pimd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoospf6d: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:26:01 +0000 (19:26 +0300)]
ospf6d: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agonhrpd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:25:43 +0000 (19:25 +0300)]
nhrpd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoldpd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:25:18 +0000 (19:25 +0300)]
ldpd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoisisd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:24:54 +0000 (19:24 +0300)]
isisd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobfdd: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:24:28 +0000 (19:24 +0300)]
bfdd: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: Do not explicitly set the thread pointer to NULL
Donatas Abraitis [Mon, 4 Oct 2021 16:23:55 +0000 (19:23 +0300)]
zebra: Do not explicitly set the thread pointer to NULL

FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoospf6d: Ensure expire thread is properly stopped
Donald Sharp [Mon, 4 Oct 2021 12:37:16 +0000 (08:37 -0400)]
ospf6d: Ensure expire thread is properly stopped

The lsa->expire thread is for keeping track of when we
are expecting to expire(remove/delete) a lsa.  There
are situations where we just decide to straight up
delete the lsa, but we are not ensuring that the
lsa is not already setup for expiration.
In that case just stop the expiry thread and
do the deletion.

Additionally there was a case where ospf6d was
just dropping the fact that a thread was already
scheduled for expiration.  In that case we
should just setup the timer again and it will
reset it appropriately.

Fixes: #9721
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Don't set NULL for struct thread at bgp_dump_interval_func()
Donatas Abraitis [Mon, 4 Oct 2021 14:49:06 +0000 (17:49 +0300)]
bgpd: Don't set NULL for struct thread at bgp_dump_interval_func()

NULL is already handled by thread_fetch().

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9689 from AnuradhaKaruppiah/bgp-evpn-lttng
Donatas Abraitis [Mon, 4 Oct 2021 16:05:41 +0000 (19:05 +0300)]
Merge pull request #9689 from AnuradhaKaruppiah/bgp-evpn-lttng

bgpd: initial batch of evpn lttng tracepoints

3 years agoeigrpd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:47:29 +0000 (09:47 -0400)]
eigrpd: Ensure better `struct thread *` semantics

1) Do not explicitly set the thread pointer to NULL.
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

2) Fix mixup of `struct eigrp_interface` and `struct eigrp`
usage of the same thread pointer.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoripd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:36:27 +0000 (09:36 -0400)]
ripd: Ensure better `struct thread *` semantics

Do not explicitly set the thread pointer to NULL.
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoripngd: Ensure better `struct thread *` semantics
Donald Sharp [Mon, 4 Oct 2021 13:28:36 +0000 (09:28 -0400)]
ripngd: Ensure better `struct thread *` semantics

1) Remove `struct thread *` pointers that are never used
2) Do not explicitly set the thread pointer to NULL.
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics.  This is espacially true for the functions we
end up calling the thread for.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: remove unused function declaration
Igor Ryzhov [Mon, 4 Oct 2021 12:23:46 +0000 (15:23 +0300)]
isisd: remove unused function declaration

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: fix debugging-ospf label
Igor Ryzhov [Mon, 4 Oct 2021 12:22:24 +0000 (15:22 +0300)]
doc: fix debugging-ospf label

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: When removing v6 address being used as a nexthop ensure peer is reset
Donald Sharp [Wed, 29 Sep 2021 15:42:19 +0000 (11:42 -0400)]
bgpd: When removing v6 address being used as a nexthop ensure peer is reset

With v6 interface based peering, we send the global as well as the LL address
as nexthops to the peer.  When either of these were removed on the interface
we were not necessarily resetting the connection.  Leaving bgp in a state
where the peer had reachability for addresses that are no longer in use.

Modify the code that when we receive an interface address deletion
event.  Check to see that we are using the v6 address as nexthops
for that peer and if so, tell it to reset.

I initially struggled with a hard reset of the peer or a clear but
choose to follow other places in the code that we noticed address
changes that resulted in hard resets.

Ticket: #2799568
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: bgp_announce_route should know if we should force the update or not
Donald Sharp [Fri, 1 Oct 2021 14:32:57 +0000 (10:32 -0400)]
bgpd: bgp_announce_route should know if we should force the update or not

When calling bgp_announce_route allow it to properly set the flag
to force an update to go out or not.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: add nhg id to show ip route json
Chirag Shah [Sun, 3 Oct 2021 22:55:03 +0000 (15:55 -0700)]
zebra: add nhg id to show ip route json

Add json field nexthop group id to
'show ip route json'.

Testing Done:
{
  "27.0.0.14\/32":[
    {
      "prefix":"27.0.0.14\/32",
      "protocol":"bgp",
      "selected":true,
      "destSelected":true,
      "distance":20,
      "metric":0,
      "installed":true,
      "table":254,
      "internalStatus":16,
      "internalFlags":8,
      "internalNextHopNum":2,
      "internalNextHopActiveNum":2,
      "nexthopGroupId":103,     <---- New field
      "uptime":"00:04:37",
      "nexthops":[
        {
          "ip":"fe80::202:ff:fe00:11",
          "interfaceName":"uplink-1",
        },
        {
          "ip":"fe80::202:ff:fe00:1d",
          "interfaceName":"uplink-2",
        }
      ]
    }
  ]
}

Signed-off-by: Chirag Shah <chirag@nvidia.com>
3 years agoMerge pull request #9714 from idryzhov/bgp-ext-comm-doc
Donatas Abraitis [Sat, 2 Oct 2021 17:14:11 +0000 (20:14 +0300)]
Merge pull request #9714 from idryzhov/bgp-ext-comm-doc

doc: fix range for bgp expanded community list

3 years agoMerge pull request #9710 from idryzhov/bgp-distribute-list-update
Donatas Abraitis [Sat, 2 Oct 2021 17:12:47 +0000 (20:12 +0300)]
Merge pull request #9710 from idryzhov/bgp-distribute-list-update

bgpd: fix access-list update callback

3 years agoMerge pull request #9701 from AnuradhaKaruppiah/lttng-build-fix
Donatas Abraitis [Sat, 2 Oct 2021 17:11:32 +0000 (20:11 +0300)]
Merge pull request #9701 from AnuradhaKaruppiah/lttng-build-fix

bgpd: fix build error seen when lttng is enabled

3 years agoospfd: GR helper functionality change in helper exit
rgirada [Fri, 1 Oct 2021 18:59:11 +0000 (11:59 -0700)]
ospfd: GR helper functionality change in helper exit

Description:
As per the RFC 3623 section 3.2,
OSPF nbr shouldn't be deleted even in unsuccessful helper exit.

1. Made the changes to keep neighbour even after exit.
2. Restart the dead timer after expiry in helper. Otherwise, Restarter
   will be in FULL state in helper forever until it receives the 'hello'.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
3 years agobgpd: initial batch of evpn lttng tracepoints
Anuradha Karuppiah [Tue, 28 Sep 2021 18:18:43 +0000 (11:18 -0700)]
bgpd: initial batch of evpn lttng tracepoints

Low overhead bgp-evpn TPs have been added which push data out in a binary
format -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@switch:~# lttng list --userspace |grep "frr_bgp:evpn"
      frr_bgp:evpn_mh_nh_rmac_zsend (loglevel: TRACE_DEBUG_LINE (13)) (type: tracepoint)
      frr_bgp:evpn_mh_nh_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_nhg_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mh_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_bum_vtep_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
      frr_bgp:evpn_mac_ip_zsend (loglevel: TRACE_INFO (6)) (type: tracepoint)
root@switch:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

In addition to the tracepoints a babeltrace python plugin for pretty
printing (binary data is converted into grepable strings). Sample usage -
frr_babeltrace.py trace_path

Sample tracepoint output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1. frr_bgp: evpn_mac_ip_zsend
frr_bgp:evpn_mac_ip_zsend {'action': 'add', 'vni': 1007, 'mac': '00:02:00:00:00:04', 'ip': 'fe80::202:ff:fe00:4', 'vtep': '27.0.0.15', 'esi': '03:44:38:39:ff:ff:01:00:00:02'}

2. frr_bgp: evpn_mh_vtep_zsend
frr_bgp:evpn_mh_vtep_zsend {'action': 'add', 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vtep': '27.0.0.16'}

3. frr_bgp: evpn_mh_nhg_zsend
frr_bgp:evpn_mh_nhg_zsend {'action': 'add', 'type': 'v4', 'nhg': 74999998, 'esi': '03:44:38:39:ff:ff:01:00:00:02', 'vrf': 85}

4. frr_bgp: evpn_mh_nh_zsend
frr_bgp:evpn_mh_nh_zsend {'nhg': 74999998, 'vtep': '27.0.0.16', 'svi': 93}

5. frr_bgp: evpn_mh_nh_rmac_zsend
frr_bgp:evpn_mh_nh_rmac_zsend {'action': 'add', 'vrf': 85, 'nh': '::ffff:1b00:12', 'rmac': '00:02:00:00:00:50'}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agodoc: fix range for bgp expanded community list
Igor Ryzhov [Fri, 1 Oct 2021 15:36:02 +0000 (18:36 +0300)]
doc: fix range for bgp expanded community list

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: fix ospf distribute-list command and description
Igor Ryzhov [Fri, 1 Oct 2021 10:05:40 +0000 (13:05 +0300)]
doc: fix ospf distribute-list command and description

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd: fix access-list update callback
Igor Ryzhov [Fri, 1 Oct 2021 09:42:04 +0000 (12:42 +0300)]
bgpd: fix access-list update callback

When a regular access-list is updated, we should update references to
regular access-lists, not as-path access-lists.

Fixes #9707.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9712 from idryzhov/travis-gprc
Donald Sharp [Fri, 1 Oct 2021 11:34:44 +0000 (07:34 -0400)]
Merge pull request #9712 from idryzhov/travis-gprc

docker: remove grpc from Travis CI

3 years agodocker: remove grpc from Travis CI
Igor Ryzhov [Fri, 1 Oct 2021 11:04:42 +0000 (14:04 +0300)]
docker: remove grpc from Travis CI

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: minor struct compare issues.
Manoj Naragund [Thu, 30 Sep 2021 16:15:18 +0000 (09:15 -0700)]
ospf6d: minor struct compare issues.

Problem Statement:
Multiple struct compare using memcmp, which might result in issue due to
structure padding/alignment.

Fix:
The code changes involve structure member by member comparison to
remove any issues related to padding/alignment.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
(cherry picked from commit 67db821a1d6d68b19862d50b68ed19278c5f2422)

3 years agobgpd: fix build error seen when lttng is enabled
Anuradha Karuppiah [Thu, 16 Sep 2021 18:46:02 +0000 (11:46 -0700)]
bgpd: fix build error seen when lttng is enabled

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agoMerge pull request #9694 from mjstapp/fix_topo_pim_cmp
Igor Ryzhov [Thu, 30 Sep 2021 09:40:55 +0000 (12:40 +0300)]
Merge pull request #9694 from mjstapp/fix_topo_pim_cmp

tests: fix string comparison in lib/pim.py

3 years ago*: cleanup interface loopback/vrf check
Igor Ryzhov [Thu, 30 Sep 2021 09:31:05 +0000 (12:31 +0300)]
*: cleanup interface loopback/vrf check

There's a helper function to check whether the interface is loopback or
VRF - if_is_loopback_or_vrf. Let's use it whenever we need to check that.

There's no functional change in this commit.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: fix string comparison in lib/pim.py
Mark Stapp [Wed, 29 Sep 2021 15:49:43 +0000 (11:49 -0400)]
tests: fix string comparison in lib/pim.py

Use correct string comparison syntax in lib/pim.py

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
3 years agoMerge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages
David Lamparter [Wed, 29 Sep 2021 12:35:35 +0000 (14:35 +0200)]
Merge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages

frrmod_load(): fix error messages

3 years agoMerge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf
Donald Sharp [Wed, 29 Sep 2021 11:29:39 +0000 (07:29 -0400)]
Merge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf

tests:  get bgp_l3vpn_to_bgp_vrf running again, also improve logging (minor)

3 years agoMerge pull request #9422 from pguibert6WIND/update_autort_l3vni
Sri Mohana Singamsetty [Tue, 28 Sep 2021 16:15:34 +0000 (09:15 -0700)]
Merge pull request #9422 from pguibert6WIND/update_autort_l3vni

bgpd: update auto route target for l3vni appropriately

3 years agotests: get bgp_l3vpn_to_bgp_vrf running, also improve logging
Lou Berger [Tue, 28 Sep 2021 15:29:46 +0000 (11:29 -0400)]
tests:  get bgp_l3vpn_to_bgp_vrf running, also improve logging

Signed-off-by: Lou Berger <lberger@labn.net>
3 years agoMerge pull request #9669 from LabNConsulting/chopps/topo-sudo-env
Quentin Young [Tue, 28 Sep 2021 14:53:23 +0000 (10:53 -0400)]
Merge pull request #9669 from LabNConsulting/chopps/topo-sudo-env

3 years agoMerge pull request #9677 from ton31337/fix/zlog_newline_not_needed
Donald Sharp [Tue, 28 Sep 2021 14:44:54 +0000 (10:44 -0400)]
Merge pull request #9677 from ton31337/fix/zlog_newline_not_needed

tools: Add coccinelle script to catch \n or \r at the end of zlog_*

3 years agoMerge pull request #9682 from adrianomarto/mesh-group-fix
Russ White [Tue, 28 Sep 2021 14:21:17 +0000 (10:21 -0400)]
Merge pull request #9682 from adrianomarto/mesh-group-fix

pimd: fixing command "no ip msdp mesh-group member"

3 years agopimd: fixing command "no ip msdp mesh-group member"
Adriano Marto Reis [Tue, 28 Sep 2021 02:38:41 +0000 (12:38 +1000)]
pimd: fixing command "no ip msdp mesh-group member"

Deleting a mesh-group member no longer deletes the mesh-group.

Complete bug description at:
https://github.com/FRRouting/frr/issues/9664

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
3 years agoMerge pull request #9675 from opensourcerouting/pim-bsm-uaf
Donald Sharp [Mon, 27 Sep 2021 13:45:38 +0000 (09:45 -0400)]
Merge pull request #9675 from opensourcerouting/pim-bsm-uaf

pimd: fix UAF/heap corruption in BSM code

3 years agoMerge pull request #9673 from donaldsharp/bgp_paf
David Lamparter [Mon, 27 Sep 2021 13:37:43 +0000 (15:37 +0200)]
Merge pull request #9673 from donaldsharp/bgp_paf

3 years agotools: Add coccinelle script to catch \n or \r at the end of zlog_*
Donatas Abraitis [Mon, 27 Sep 2021 12:20:51 +0000 (15:20 +0300)]
tools: Add coccinelle script to catch \n or \r at the end of zlog_*

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9672 from donaldsharp/ospf6_newline
David Lamparter [Mon, 27 Sep 2021 08:45:17 +0000 (10:45 +0200)]
Merge pull request #9672 from donaldsharp/ospf6_newline

3 years agopimd: fix UAF/heap corruption in BSM code
David Lamparter [Mon, 27 Sep 2021 08:33:33 +0000 (10:33 +0200)]
pimd: fix UAF/heap corruption in BSM code

This `XFREE()` call is in plainly in the wrong spot.  `rp_all` (the
224.0.0.0/4 entry) isn't supposed to be free'd ever, and the
conditional above makes quite clear that it remains in use.

It may be possible to exploit this as a heap corruption bug, maybe even
as RCE.  I haven't tried; I randomly noticed this while working on the
BSM code.  Luckily this code is only run by the CLI for the clear
command, so the surface is very small.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Don't lookup paf structure get straight to the point
Donald Sharp [Sun, 26 Sep 2021 23:36:03 +0000 (19:36 -0400)]
bgpd: Don't lookup paf structure get straight to the point

The paf data structure is stored based upon an internal
bgp enum.  The code is looking over all AFI/SAFI's and
doing a paf_af_find which then calls afindex to find
the right paf structure.  Let's just loop over the
peer->peer_af_array[] and cut straight to the chase.
Under some loads the paf_af_find was taking up 6%
of the run time.  This removes it entirely.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Log messages cannot have newlines
Donald Sharp [Sun, 26 Sep 2021 23:16:10 +0000 (19:16 -0400)]
ospf6d: Log messages cannot have newlines

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: add sudo environment setup info for topotests
Christian Hopps [Sat, 25 Sep 2021 18:59:13 +0000 (14:59 -0400)]
doc: add sudo environment setup info for topotests

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agoMerge pull request #9638 from proelbtn/fix-multipath-srv6-sid
Quentin Young [Fri, 24 Sep 2021 18:58:12 +0000 (14:58 -0400)]
Merge pull request #9638 from proelbtn/fix-multipath-srv6-sid