]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoospf6d: fix selection of NSSA forwarding address
Renato Westphal [Wed, 6 Oct 2021 00:25:55 +0000 (21:25 -0300)]
ospf6d: fix selection of NSSA forwarding address

Change ospf6_get_nssa_fwd_addr() to try finding a global address
on any interface of the area and not on the first one only.

Additionally, do a micro-optimization in
ospf6_interface_get_global_address() to return as soon as a global
address is found.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: add "nssa" option to the "debug ospf6 lsa" command
Renato Westphal [Wed, 6 Oct 2021 00:25:55 +0000 (21:25 -0300)]
ospf6d: add "nssa" option to the "debug ospf6 lsa" command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: remove unnecessary code
Renato Westphal [Thu, 23 Sep 2021 15:54:16 +0000 (12:54 -0300)]
ospf6d: remove unnecessary code

Every received or originated LSA is automatically scheduled to be
refreshed periodically, there's no need to do that manually here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: declare neighbor memtype as static
Renato Westphal [Thu, 23 Sep 2021 15:21:09 +0000 (12:21 -0300)]
ospf6d: declare neighbor memtype as static

This is the only ospf6d memtype that wasn't being declared as static.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: remove unused bitfield
Renato Westphal [Thu, 23 Sep 2021 04:25:56 +0000 (01:25 -0300)]
ospf6d: remove unused bitfield

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: remove redundant loop
Renato Westphal [Thu, 23 Sep 2021 04:14:27 +0000 (01:14 -0300)]
ospf6d: remove redundant loop

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: remove unguarded debug message
Renato Westphal [Thu, 23 Sep 2021 04:14:13 +0000 (01:14 -0300)]
ospf6d: remove unguarded debug message

This debug message is of little use so remove it instead of adding
a debug guard for it.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: remove unused function parameter
Renato Westphal [Thu, 23 Sep 2021 04:14:00 +0000 (01:14 -0300)]
ospf6d: remove unused function parameter

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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

2 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>
2 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>
2 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>
2 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>
2 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

2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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>
2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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

2 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

2 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

2 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>
2 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>
2 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>
2 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>
2 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>
2 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

2 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>
2 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>
2 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

2 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>
2 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

2 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)

2 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

2 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>
2 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

2 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_*

2 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"

2 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>
2 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

2 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

2 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>
2 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

2 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>
2 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>
2 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>
2 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>
2 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

2 years agoMerge pull request #9659 from idryzhov/dev-doc-fix
Quentin Young [Fri, 24 Sep 2021 18:14:44 +0000 (14:14 -0400)]
Merge pull request #9659 from idryzhov/dev-doc-fix

doc: fix code block in grpc docs

2 years agoMerge pull request #9661 from ton31337/fix/bgp_frrtrace_for_lttng
Quentin Young [Fri, 24 Sep 2021 17:53:03 +0000 (13:53 -0400)]
Merge pull request #9661 from ton31337/fix/bgp_frrtrace_for_lttng

2 years agoMerge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate
Russ White [Fri, 24 Sep 2021 17:42:49 +0000 (13:42 -0400)]
Merge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate

ospf6d: add a knob to generate Type-7 default routes

2 years agoMerge pull request #9660 from pguibert6WIND/bgp_error_swap
Donatas Abraitis [Thu, 23 Sep 2021 17:04:24 +0000 (20:04 +0300)]
Merge pull request #9660 from pguibert6WIND/bgp_error_swap

bgpd: swap bgp error value with file descriptor value

2 years agobgpd: Make sure bgp_dest lock/unlock tracepoints works for LTTng as well
Donatas Abraitis [Thu, 23 Sep 2021 13:59:08 +0000 (16:59 +0300)]
bgpd: Make sure bgp_dest lock/unlock tracepoints works for LTTng as well

Tested with both UDST and LTTng, both are OK.

```
[13:57:31.346131253] (+?.?????????) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "10.0.2.0/24", count = 3 }
[13:57:31.346154756] (+0.000023503) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.0.0/24", count = 3 }
[13:57:31.346156699] (+0.000001943) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.10.0/24", count = 2 }
[13:57:31.346157570] (+0.000000871) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.1/32", count = 2 }
[13:57:31.346158521] (+0.000000951) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.2/32", count = 2 }
[13:57:31.356149109] (+0.009990588) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "10.0.2.0/24", count = 3 }
[13:57:31.356155889] (+0.000006780) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.0.0/24", count = 3 }
[13:57:31.356156840] (+0.000000951) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.10.0/24", count = 2 }
[13:57:31.356157751] (+0.000000911) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.1/32", count = 2 }
[13:57:31.356158683] (+0.000000932) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.2/32", count = 2 }
[13:57:34.508252238] (+3.152093555) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.1/32", count = 2 }
[13:57:34.508289549] (+0.000037311) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.2/32", count = 2 }
[13:57:34.508307544] (+0.000017995) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.3/32", count = 2 }
[13:57:34.508433878] (+0.000126334) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "10.0.2.0/24", count = 2 }
[13:57:34.508435891] (+0.000002013) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "10.0.2.0/24", count = 2 }
[13:57:34.508458182] (+0.000022291) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.0.0/24", count = 2 }
[13:57:34.508458852] (+0.000000670) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.0.0/24", count = 2 }
[13:57:34.508472821] (+0.000013969) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.10.0/24", count = 1 }
[13:57:34.508473482] (+0.000000661) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.10.0/24", count = 1 }
[13:57:34.508487041] (+0.000013559) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.100.1/32", count = 1 }
[13:57:34.508487792] (+0.000000751) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.100.1/32", count = 1 }
```

Converting bgp_dest_lock_node/bgp_dest_unlock_node to non-inlined function
because LTTng can't work properly with inlined and the compiler does not like
it.

Not sure how it would be with the performance, but let's see.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agotools: Require a lower LTTng version to compile
Donatas Abraitis [Thu, 23 Sep 2021 13:58:52 +0000 (16:58 +0300)]
tools: Require a lower LTTng version to compile

Debian 9 has 2.9.x, only Ubuntu >= 18 has 2.10.x.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #9084 from louis-oui/fix-ospf6-router-id
Igor Ryzhov [Thu, 23 Sep 2021 16:03:35 +0000 (19:03 +0300)]
Merge pull request #9084 from louis-oui/fix-ospf6-router-id

ospf6d: fix LSAs remain in LSDB with an old router-id value

2 years agobgpd: swap bgp error value with file descriptor value
Philippe Guibert [Thu, 23 Sep 2021 11:57:56 +0000 (13:57 +0200)]
bgpd: swap bgp error value with file descriptor value

the values were swapped by mistake. fix it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agodoc: fix code block in grpc docs
Igor Ryzhov [Thu, 23 Sep 2021 09:08:12 +0000 (12:08 +0300)]
doc: fix code block in grpc docs

The code block after the :: is not displayed correctly without an empty
line in between.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoospf6d: reset areas and redistribution at router-id modification
Louis Scalbert [Thu, 10 Jun 2021 09:30:05 +0000 (11:30 +0200)]
ospf6d: reset areas and redistribution at router-id modification

The ospf6 router-id is provided by order of preference by:

 ospf6d itself if the "ospf6 router-id X.X.X.X" command is set.
- zebra. If the "ip router-id X.X.X.X" zebra command is set, the
  configured IP is provided as the ID or alternatively the highest
  loopback IPv4 address or else the highest interface IPv4 address.

The running ospf6 router-id is stored in ospf6->router-id.

ospf6->router-id can change in the following conditions:

- A configuration change provides a new router-id value according to
  the above rules. ospf6->router-id is updated to the new value if
  there is no adjacency in FULL state. Otherwise, the ospf6d process
  must be restarted to take the new router-id into account.
- On startup of both zebra and ospf6d, if ospf6d has not yet received a
  valid router-id, ospf6d->router-id is set to 0 (i.e. 0.0.0.0). Then,
  zebra notifies ospf6d that the router-id is available.

At ospf6->router-id, the current behavior of ospf6d is the following:

- The self generated LSAs that refer to the previous router-id as the
  advertising router are kept.
- Self generated LSAs are created with router-id value.
- LSAs from the redistribution that refer to the previous router-id are
  kept and no new redistribution LSAs are created.

As a consequence, the routers in the ospf6 areas will get incorrect
LSAs and might not be able to install prefixes of those LSAs into their
RIB.

This fix solves this issue by resetting the areas and the redistribution
when ospf6->router-id updated.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #9650 from mjstapp/fix_dup_lookup_netlink
Sri Mohana Singamsetty [Wed, 22 Sep 2021 23:18:19 +0000 (16:18 -0700)]
Merge pull request #9650 from mjstapp/fix_dup_lookup_netlink

zebra: stop asking for AF_BRIDGE interface info twice

2 years agoMerge pull request #9653 from pguibert6WIND/carriage_return
Sri Mohana Singamsetty [Wed, 22 Sep 2021 23:17:50 +0000 (16:17 -0700)]
Merge pull request #9653 from pguibert6WIND/carriage_return

bgpd: add carriage return when dumping tags from all evpn rds

2 years agoMerge pull request #9429 from yar-fed/vtysh-err-not-running
Igor Ryzhov [Wed, 22 Sep 2021 19:52:52 +0000 (22:52 +0300)]
Merge pull request #9429 from yar-fed/vtysh-err-not-running

vtysh: Add error code if daemon is not running

2 years agoMerge pull request #9647 from opensourcerouting/ospf-gr-cmd-rename
Donald Sharp [Wed, 22 Sep 2021 18:53:40 +0000 (14:53 -0400)]
Merge pull request #9647 from opensourcerouting/ospf-gr-cmd-rename

ospfd, ospf6d: rename the "graceful-restart helper-only" command

2 years agoMerge pull request #9654 from opensourcerouting/workflow-typesafe-containers
Mark Stapp [Wed, 22 Sep 2021 14:12:09 +0000 (10:12 -0400)]
Merge pull request #9654 from opensourcerouting/workflow-typesafe-containers

doc/workflow: prefer typesafe containers

2 years agoMerge pull request #9635 from donaldsharp/ospf6_unit
David Lamparter [Wed, 22 Sep 2021 12:25:46 +0000 (14:25 +0200)]
Merge pull request #9635 from donaldsharp/ospf6_unit

2 years agoMerge pull request #9646 from LabNConsulting/ziemba/skiplist-level-counters-int
Donald Sharp [Wed, 22 Sep 2021 11:21:14 +0000 (07:21 -0400)]
Merge pull request #9646 from LabNConsulting/ziemba/skiplist-level-counters-int

lib: skiplist: clean up level counter implementation

2 years agoMerge pull request #9651 from proelbtn/refactor-9638
Donald Sharp [Wed, 22 Sep 2021 11:19:31 +0000 (07:19 -0400)]
Merge pull request #9651 from proelbtn/refactor-9638

bgpd: fix mpls nexthop announce in bgp_zebra_announce

2 years agodoc/workflow: prefer typesafe containers
David Lamparter [Wed, 22 Sep 2021 09:59:08 +0000 (11:59 +0200)]
doc/workflow: prefer typesafe containers

The typesafe containers have been around for quite a while now and
haven't gone up in a blaze of flames, so let's add a "strong
recommendation" to use them for new code and refactors.

For the nhrpd custom lists I'm already working to remove them; meanwhile
the old skiplists are primarily used in RFAPI (4 users outside of that),
so those could be next.

What remains are the old `list_*` and `hash_*`, which have >300 and >100
users respectively, making them a much harder problem to tackle.  And
the new hash implementation doesn't have the same level of
debug/introspection yet (it's on my TODO.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: add carriage return when dumping tags from all evpn rds
Philippe Guibert [Wed, 22 Sep 2021 07:59:44 +0000 (09:59 +0200)]
bgpd: add carriage return when dumping tags from all evpn rds

following command: show bgp l2vpn evpn rd all tags
does not append rd contexts one after the other

before:
dut-vm# show bgp l2vpn evpn rd all tags
   Network          Next Hop      In tag/Out tag
Route Distinguisher: 65000:999
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1     Route Distinguisher: 65000:1000
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1
Displayed 2 out of 2 total prefixes

after:
dut-vm# show bgp l2vpn evpn rd all tags
   Network          Next Hop      In tag/Out tag
Route Distinguisher: 65000:999
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1
Route Distinguisher: 65000:1000
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #9645 from mjstapp/fix_show_bgp_lu
Donatas Abraitis [Wed, 22 Sep 2021 06:52:09 +0000 (09:52 +0300)]
Merge pull request #9645 from mjstapp/fix_show_bgp_lu

bgpd: make show bgp labeled-unicast work

2 years agobgpd: fix mpls nexthop announce to zebra
Ryoga Saito [Wed, 22 Sep 2021 04:58:59 +0000 (04:58 +0000)]
bgpd: fix mpls nexthop announce to zebra

currently, has_valid_label is only used to check need to print debug,
but if route has normal nexthops and mpls nexthops, label information
will be printed even for normal nexthops.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agolib: skiplist: clean up level counter implementation
G. Paul Ziemba [Tue, 21 Sep 2021 14:34:20 +0000 (07:34 -0700)]
lib: skiplist: clean up level counter implementation

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2 years agoMerge pull request #9641 from idryzhov/vtysh-vrf-sort
Donald Sharp [Tue, 21 Sep 2021 20:52:59 +0000 (16:52 -0400)]
Merge pull request #9641 from idryzhov/vtysh-vrf-sort

vtysh: remove sorting of vrf node commands

2 years agoospf6d: implement Type-7 default routes for NSSA areas
Renato Westphal [Mon, 6 Sep 2021 22:52:32 +0000 (19:52 -0300)]
ospf6d: implement Type-7 default routes for NSSA areas

Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: don't generate Type-7 LSA for route created by "default-information-originate"
Renato Westphal [Wed, 8 Sep 2021 16:13:19 +0000 (13:13 -0300)]
ospf6d: don't generate Type-7 LSA for route created by "default-information-originate"

The route created by the "default-information-originate" command
isn't a regular external route. As such, an NSSA ABR shouldn't
originate a corresponding Type-7 LSA for it (there's a separate
configuration knob to generate Type-7 default routes).

While here, fix a small issue in ospf6_asbr_redistribute_add()
where routes created by "default-information-originate" were being
displayed with an incorrect "unknown" type.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: fix issue when displaying the redistribute command
Renato Westphal [Mon, 6 Sep 2021 22:51:46 +0000 (19:51 -0300)]
ospf6d: fix issue when displaying the redistribute command

When set to its default value, the metric type associated to a
"redistribute" statement shouldn't be displayed as part of the
running configuration.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospf6d: fix metric type of NSSA Type-7 LSAs
Renato Westphal [Mon, 6 Sep 2021 22:50:27 +0000 (19:50 -0300)]
ospf6d: fix metric type of NSSA Type-7 LSAs

Fix wrong comparison since route->path.metric_type is always set
to either 1 or 2. The OSPF6_PATH_TYPE_EXTERNAL2 constant, whose
value is 4, refers to a route type so its usage was incorrect here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agoospfd: rename the "graceful-restart helper-only" command
Renato Westphal [Tue, 21 Sep 2021 14:33:55 +0000 (11:33 -0300)]
ospfd: rename the "graceful-restart helper-only" command

Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Start a deprecation cycle of one year before removing the original
command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2 years agozebra: stop asking for AF_BRIDGE interface info twice
Mark Stapp [Tue, 21 Sep 2021 20:33:28 +0000 (16:33 -0400)]
zebra: stop asking for AF_BRIDGE interface info twice

There were two identical blocks of code run at init time that
requested info about AF_BRIDGE - don't see any reason to do that
twice, so remove one block.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>