]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agoMerge pull request #8458 from opensourcerouting/xref-5424
Donald Sharp [Tue, 8 Feb 2022 20:56:20 +0000 (15:56 -0500)]
Merge pull request #8458 from opensourcerouting/xref-5424

lib: RFC5424 syslog support

2 years agoMerge pull request #9066 from donaldsharp/ships_in_the_night
Russ White [Tue, 8 Feb 2022 19:41:01 +0000 (14:41 -0500)]
Merge pull request #9066 from donaldsharp/ships_in_the_night

zebra: Fix ships in the night issue

2 years agoMerge pull request #10531 from idryzhov/bgp-nexthop-cmp
Donald Sharp [Tue, 8 Feb 2022 19:40:03 +0000 (14:40 -0500)]
Merge pull request #10531 from idryzhov/bgp-nexthop-cmp

bgpd: avoid memcmp comparison of struct nexthop

2 years agoMerge pull request #10530 from idryzhov/ipaddr-cmp
Mark Stapp [Tue, 8 Feb 2022 19:35:43 +0000 (14:35 -0500)]
Merge pull request #10530 from idryzhov/ipaddr-cmp

*: use ipaddr_cmp instead of memcmp

2 years agoMerge pull request #10445 from ton31337/fix/frr-reload_stop_disabled_daemons
Donald Sharp [Tue, 8 Feb 2022 19:15:05 +0000 (14:15 -0500)]
Merge pull request #10445 from ton31337/fix/frr-reload_stop_disabled_daemons

tools: Stop disabled daemons when doing reload

2 years agoMerge pull request #10492 from ton31337/feature/pmsi_tnl_type_attr_extra
Donald Sharp [Tue, 8 Feb 2022 19:13:04 +0000 (14:13 -0500)]
Merge pull request #10492 from ton31337/feature/pmsi_tnl_type_attr_extra

bgpd: Move attr->pmsi_tnl_type to attr->extra->pmsi_tnl_type

2 years agoMerge pull request #10496 from ton31337/fix/move_struct_ecommunity_to_extra
Donald Sharp [Tue, 8 Feb 2022 19:12:15 +0000 (14:12 -0500)]
Merge pull request #10496 from ton31337/fix/move_struct_ecommunity_to_extra

bgpd: Use bgp_attr_[sg]et_ecommunity for struct ecommunity

2 years agoMerge pull request #10509 from mobash-rasool/fixes2
Donald Sharp [Tue, 8 Feb 2022 19:06:33 +0000 (14:06 -0500)]
Merge pull request #10509 from mobash-rasool/fixes2

pimd: Querier to non-querier transistion to be ignored in a case

2 years agoMerge pull request #10529 from Jafaral/doc-fix-order
Donatas Abraitis [Tue, 8 Feb 2022 19:03:19 +0000 (21:03 +0200)]
Merge pull request #10529 from Jafaral/doc-fix-order

doc: the dev tag should come after the new version commit step

2 years agoMerge pull request #10527 from idryzhov/topotest-literals
Donald Sharp [Tue, 8 Feb 2022 18:32:48 +0000 (13:32 -0500)]
Merge pull request #10527 from idryzhov/topotest-literals

tests: fix strings with topologies

2 years agoMerge pull request #10292 from opensourcerouting/pim6-addr-aux
Donald Sharp [Tue, 8 Feb 2022 18:09:08 +0000 (13:09 -0500)]
Merge pull request #10292 from opensourcerouting/pim6-addr-aux

pimd: start tackling IPv6 address operations

2 years agoMerge pull request #10511 from anlancs/ospf-substitute
Igor Ryzhov [Tue, 8 Feb 2022 17:50:22 +0000 (20:50 +0300)]
Merge pull request #10511 from anlancs/ospf-substitute

ospfd: fix loss of mixed form in "range" command

2 years agobgpd: avoid memcmp comparison of struct nexthop
Igor Ryzhov [Tue, 8 Feb 2022 17:34:28 +0000 (20:34 +0300)]
bgpd: avoid memcmp comparison of struct nexthop

Using memcmp is wrong because struct nexthop may contain unitialized
padding bytes that should not be compared.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years ago*: use ipaddr_cmp instead of memcmp
Igor Ryzhov [Tue, 8 Feb 2022 17:31:34 +0000 (20:31 +0300)]
*: use ipaddr_cmp instead of memcmp

Using memcmp is wrong because struct ipaddr may contain unitialized
padding bytes that should not be compared.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agodoc: the dev tag should come after the new version commit step
Jafar Al-Gharaibeh [Tue, 8 Feb 2022 16:50:15 +0000 (10:50 -0600)]
doc: the dev tag should come after the new version commit step

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #10504 from qingkaishi/master
Donald Sharp [Tue, 8 Feb 2022 15:10:52 +0000 (10:10 -0500)]
Merge pull request #10504 from qingkaishi/master

babeld: fix the checks for truncated packets

2 years agotests: fix strings with topologies
Igor Ryzhov [Tue, 8 Feb 2022 14:00:44 +0000 (17:00 +0300)]
tests: fix strings with topologies

Add `r` prefix to treat backslashes as literals.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10517 from idryzhov/isis_router_cap_tlv_fixes
Russ White [Tue, 8 Feb 2022 13:35:45 +0000 (08:35 -0500)]
Merge pull request #10517 from idryzhov/isis_router_cap_tlv_fixes

isisd: fix router capability TLV parsing issues

2 years agoMerge pull request #10293 from rgirada/ospf_lsid
Russ White [Tue, 8 Feb 2022 13:33:33 +0000 (08:33 -0500)]
Merge pull request #10293 from rgirada/ospf_lsid

ospfd: Modifying LSID generation algorithm

2 years agoMerge pull request #9649 from proelbtn/add-support-for-end-dt4
Russ White [Tue, 8 Feb 2022 13:30:02 +0000 (08:30 -0500)]
Merge pull request #9649 from proelbtn/add-support-for-end-dt4

add support for SRv6 IPv4 L3VPN

2 years agoMerge pull request #10417 from Orange-OpenSource/TE
Russ White [Tue, 8 Feb 2022 13:26:29 +0000 (08:26 -0500)]
Merge pull request #10417 from Orange-OpenSource/TE

Add Constraints Shortest Path First algorithm

2 years agoisisd: fix router capability TLV parsing issues
Juraj Vijtiuk [Wed, 13 Oct 2021 16:32:53 +0000 (18:32 +0200)]
isisd: fix router capability TLV parsing issues

isis_tlvs.c would fail at multiple places if incorrect TLVs were
received causing stream assertion violations.
This patch fixes the issues by adding missing length checks, missing
consumed length updates and handling malformed Segment Routing subTLVs.

Signed-off-by: Juraj Vijtiuk <juraj.vijtiuk@sartura.hr>
Small adjustments by Igor Ryzhov:
- fix incorrect replacement of srgb by srlb on lines 3052 and 3054
- add length check for ISIS_SUBTLV_ALGORITHM
- fix conflict in fuzzing data during rebase

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2 years agoMerge pull request #10524 from donaldsharp/pim_assert
Jafar Al-Gharaibeh [Tue, 8 Feb 2022 04:45:46 +0000 (22:45 -0600)]
Merge pull request #10524 from donaldsharp/pim_assert

pimd: Modify `show ip pim assert` to only show interesting bits

2 years agopimd: Modify `show ip pim assert` to only show interesting bits
Donald Sharp [Tue, 8 Feb 2022 00:55:00 +0000 (19:55 -0500)]
pimd: Modify `show ip pim assert` to only show interesting bits

`show ip pim assert` shows S,G ifchannel information even when
there is no information available about the assert process.

Fix the code to not dump non-interesting cases.

Fixes: 10462
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Abstract nhg deletion to reduce code duplication
Donald Sharp [Thu, 22 Jul 2021 13:21:15 +0000 (09:21 -0400)]
zebra: Abstract nhg deletion to reduce code duplication

Reduce code duplication when we are cleaning up nexthop
groups.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Fix ships in the night issue
Donald Sharp [Thu, 24 Jun 2021 16:23:33 +0000 (12:23 -0400)]
zebra: Fix ships in the night issue

When using wait for install there exists situations where
zebra will issue several route change operations to the kernel
but end up in a state where we shouldn't be at the end
due to extra data being received.  Example:

a) zebra receives from bgp a route change, installs sends the
route to the kernel.
b) zebra receives a route deletion from bgp, removes the
struct route entry and then sends to the kernel a deletion.
c) zebra receives an asynchronous notification that (a) succeeded
but we treat this as a new route.

This is the ships in the night problem.  In this case if we receive
notification from the kernel about a route that we know nothing
about and we are not in startup and we are doing asic offload
then we can ignore this update.

Ticket: #2563300
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10518 from donaldsharp/af_unspec
Igor Ryzhov [Mon, 7 Feb 2022 20:29:33 +0000 (23:29 +0300)]
Merge pull request #10518 from donaldsharp/af_unspec

Af unspec

2 years agoMerge pull request #10441 from donaldsharp/pim_bsr_warning_remove
Russ White [Mon, 7 Feb 2022 19:03:53 +0000 (14:03 -0500)]
Merge pull request #10441 from donaldsharp/pim_bsr_warning_remove

pimd: Only remove bsr NHT if we actually have tracked something

2 years agobfdd: Use AF_UNSPEC instead of comparing to 0
Donald Sharp [Mon, 7 Feb 2022 18:25:21 +0000 (13:25 -0500)]
bfdd: Use AF_UNSPEC instead of comparing to 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Use AF_UNSPEC instead of setting to 0
Donald Sharp [Mon, 7 Feb 2022 18:22:41 +0000 (13:22 -0500)]
zebra: Use AF_UNSPEC instead of setting to 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Use AF_UNSPEC intead of setting to 0
Donald Sharp [Mon, 7 Feb 2022 18:21:55 +0000 (13:21 -0500)]
lib: Use AF_UNSPEC intead of setting to 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoospfd: Use AF_UNSPEC instead of setting to 0
Donald Sharp [Mon, 7 Feb 2022 18:20:43 +0000 (13:20 -0500)]
ospfd:  Use AF_UNSPEC instead of setting to 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Use AF_UNSPEC instead of setting to 0
Donald Sharp [Mon, 7 Feb 2022 18:16:59 +0000 (13:16 -0500)]
bgpd: Use AF_UNSPEC instead of setting to 0

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10510 from ton31337/fix/rmap_dummy_attr_flush
Igor Ryzhov [Mon, 7 Feb 2022 14:40:13 +0000 (17:40 +0300)]
Merge pull request #10510 from ton31337/fix/rmap_dummy_attr_flush

bgpd: Flush temporary attributes after route-map apply

2 years agobgpd: Print route-map name for filtred outgoing prefixes
Donatas Abraitis [Mon, 7 Feb 2022 10:04:10 +0000 (12:04 +0200)]
bgpd: Print route-map name for filtred outgoing prefixes

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agopimd: Querier to non-querier transistion to be ignored in a case
Mobashshera Rasool [Mon, 7 Feb 2022 07:23:21 +0000 (23:23 -0800)]
pimd: Querier to non-querier transistion to be ignored in a case

As per RFC 2236 section 3, when the leave message is received at a querier,
it starts sending Query messages for "last Member Query Interval*query count"
During this time there should not be any querier to non-querier
transition and the same router needs to send the remaning queries.

Fixes: #10422
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agobgpd: Flush temporary attributes after route-map apply
Donatas Abraitis [Mon, 7 Feb 2022 08:50:33 +0000 (10:50 +0200)]
bgpd: Flush temporary attributes after route-map apply

Fixes crash:

```
Received signal 6 at 1644222173 (si_addr 0x6f000012d2, PC 0x7f79274cbfb7); aborting...
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(zlog_backtrace_sigsafe+0x6d) [0x7f79282e079d]
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(zlog_signal+0xf3) [0x7f79282e0993]
/usr/lib/x86_64-linux-gnu/frr/libfrr.so.0(+0xbd881) [0x7f792830b881]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980) [0x7f7927890980]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7) [0x7f79274cbfb7]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141) [0x7f79274cd921]
/lib/x86_64-linux-gnu/libc.so.6(+0x89967) [0x7f7927516967]
/lib/x86_64-linux-gnu/libc.so.6(+0x909da) [0x7f792751d9da]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x620) [0x7f7927525050]
/usr/lib/frr/bgpd(+0x1e7c1c) [0x55b5c53b1c1c]
/usr/lib/frr/bgpd(aspath_free+0x28) [0x55b5c53b1c78]
/usr/lib/frr/bgpd(bgp_attr_flush+0x245) [0x55b5c52abc15]
/usr/lib/frr/bgpd(subgroup_announce_check+0x1137) [0x55b5c530c5d7]
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10432 from sworleys/PBR-Fix
Jafar Al-Gharaibeh [Sun, 6 Feb 2022 21:18:22 +0000 (15:18 -0600)]
Merge pull request #10432 from sworleys/PBR-Fix

pbrd: pbr route maps get addr family of nhgs

2 years agoMerge pull request #10471 from ton31337/fix/release_candidate_procedure
Jafar Al-Gharaibeh [Sun, 6 Feb 2022 21:06:16 +0000 (15:06 -0600)]
Merge pull request #10471 from ton31337/fix/release_candidate_procedure

doc: Add a commands snippet to workflow about what to do in RC1 phase

2 years agoMerge pull request #10323 from opensourcerouting/ospf6-lsa-stats
Igor Ryzhov [Sun, 6 Feb 2022 18:46:13 +0000 (21:46 +0300)]
Merge pull request #10323 from opensourcerouting/ospf6-lsa-stats

ospf6d: LSA statistics

2 years agoMerge pull request #10475 from ton31337/fix/coverity_bgpd
Igor Ryzhov [Sun, 6 Feb 2022 18:06:15 +0000 (21:06 +0300)]
Merge pull request #10475 from ton31337/fix/coverity_bgpd

bgpd: Coverity fixes

2 years agoMerge pull request #10494 from whichbug/fix#10487
Igor Ryzhov [Sun, 6 Feb 2022 17:55:26 +0000 (20:55 +0300)]
Merge pull request #10494 from whichbug/fix#10487

babeld: add a check for truncated packets

2 years agodoc: Add a commands snippet to workflow about what to do in the 1st phase
Donatas Abraitis [Tue, 1 Feb 2022 20:25:22 +0000 (22:25 +0200)]
doc: Add a commands snippet to workflow about what to do in the 1st phase

What we should do when creating stabilization branch from the master.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Free only subattributes, not the whole attr_extra pointer
Donatas Abraitis [Sat, 5 Feb 2022 08:01:57 +0000 (10:01 +0200)]
bgpd: Free only subattributes, not the whole attr_extra pointer

Avoid use-after-free situation. Flush attr_extra structure only when flushing
all attributes, not just for unintern.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Move attr->pmsi_tnl_type to attr->extra->pmsi_tnl_type
Donatas Abraitis [Sat, 5 Feb 2022 08:01:45 +0000 (10:01 +0200)]
bgpd: Move attr->pmsi_tnl_type to attr->extra->pmsi_tnl_type

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10472 from ton31337/fix/no_need_to_decorate
Jafar Al-Gharaibeh [Sat, 5 Feb 2022 01:41:43 +0000 (19:41 -0600)]
Merge pull request #10472 from ton31337/fix/no_need_to_decorate

tools: Skip decorating commits with references (branch name, remote)

2 years agoMerge pull request #9926 from donaldsharp/update_issues
Jafar Al-Gharaibeh [Sat, 5 Feb 2022 01:40:55 +0000 (19:40 -0600)]
Merge pull request #9926 from donaldsharp/update_issues

zebra: Fix v6 route replace failure turned into success

2 years agobabeld: fix #10502 #10503 by repairing the checks on length
qingkaishi [Fri, 4 Feb 2022 21:41:11 +0000 (16:41 -0500)]
babeld: fix #10502 #10503 by repairing the checks on length

This patch repairs the checking conditions on length in four functions:
babel_packet_examin, parse_hello_subtlv, parse_ihu_subtlv, and parse_update_subtlv

Signed-off-by: qingkaishi <qingkaishi@gmail.com>
2 years agotools: Skip decorating commits with references (branch name, remote)
Donatas Abraitis [Tue, 1 Feb 2022 20:42:10 +0000 (22:42 +0200)]
tools: Skip decorating commits with references (branch name, remote)

I think we don't care about this in release notes.

bgpd,pimd,isisd,nhrpd: Convert to vty_json() (origin/fix/vty_json)
ospf6d: Fix memory leak for `show ipv6 ospf6 zebra json` (origin/fix/zebra_ospf6d_json_leak)

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10501 from donaldsharp/more_zebra_show
Jafar Al-Gharaibeh [Fri, 4 Feb 2022 21:13:45 +0000 (15:13 -0600)]
Merge pull request #10501 from donaldsharp/more_zebra_show

More zebra show

2 years agobabeld: fix #10487 by adding a check on packet length
whichbug [Thu, 3 Feb 2022 17:01:31 +0000 (12:01 -0500)]
babeld: fix #10487 by adding a check on packet length

The body length of a packet should satisfy the condition:
packetlen >= bodylen + 4. Otherwise, heap overflows may happen.

Signed-off-by: whichbug <whichbug@github.com>
2 years agoMerge pull request #10470 from ton31337/fix/advance_packaging_version_for_development
Jafar Al-Gharaibeh [Fri, 4 Feb 2022 20:38:12 +0000 (14:38 -0600)]
Merge pull request #10470 from ton31337/fix/advance_packaging_version_for_development

debian, redhat: updating changelog for new release

2 years agozebra: Fix v6 route replace failure turned into success
Donald Sharp [Wed, 10 Nov 2021 21:58:58 +0000 (16:58 -0500)]
zebra: Fix v6 route replace failure turned into success

Currently when we have a route replace operation for v6 routes
with a new nexthop group the order of kernel installation is this:

a) New nexthop group insertion seq  1
b) Route delete operation seq 3
c) Route insertion operation seq 2

Currently the code in nl_batch_read_resp is attempting
to handle this situation by skipping the delete operation.
*BUT* it is enqueuing the context into the zebra dplane
queue before we read the response.  Since we create the ctx
with an implied success, success is being reported to the
upper level dplane and the zebra rib thinks the route has
been properly handled.

This is showing up in the zebra_seg6_route test code because
the test code is installing a seg6 route w/ sharpd and it
is failing to install because the route's nexthop is rejected:

First installation:

2021/10/29 09:28:10.218 ZEBRA: [JGWSB-SMNVE] dplane: incoming new work counter: 2
2021/10/29 09:28:10.218 ZEBRA: [Q52A7-211QJ] dplane enqueues 2 new work to provider 'Kernel'
2021/10/29 09:28:10.218 ZEBRA: [JVY1P-93VFY] dplane provider 'Kernel': processing
2021/10/29 09:28:10.218 ZEBRA: [TX9N0-9JKDF] ID (9) Dplane nexthop update ctx 0x56125390a820 op NH_INSTALL
2021/10/29 09:28:10.218 ZEBRA: [PM9ZJ-07RCP] 0:1::1/128 Dplane route update ctx 0x56125390add0 op ROUTE_INSTALL
2021/10/29 09:28:10.218 ZEBRA: [TJ327-ET8HE] netlink_send_msg: >> netlink message dump [sent]
2021/10/29 09:28:10.218 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=104 type=(104) NEWNEXTHOP flags=(0x0501) {REQUEST,DUMP,(ROOT|REPLACE|CAPPED),(ATOMIC|CREATE)} seq=9 pid=3539131282]
2021/10/29 09:28:10.218 ZEBRA: [WCX94-SW894]   nhm [family=(10) AF_INET6 scope=(0) UNIVERSE protocol=(11) ZEBRA flags=0x00000000 {}]
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(1) ID]
2021/10/29 09:28:10.218 ZEBRA: [Z4E9C-GD9EP]       9
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=20 (payload=16) type=(6) GATEWAY]
2021/10/29 09:28:10.218 ZEBRA: [STTSM-27M81]       2001::1
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(5) OIF]
2021/10/29 09:28:10.218 ZEBRA: [JR4EA-BKPTA]       6
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=6 (payload=2) type=(7) ENCAP_TYPE]
2021/10/29 09:28:10.218 ZEBRA: [JR4EA-BKPTA]       5
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=36 (payload=32) type=(32776) UNKNOWN]
2021/10/29 09:28:10.218 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=64 type=(24) NEWROUTE flags=(0x0401) {REQUEST,(ATOMIC|CREATE)} seq=10 pid=3539131282]
2021/10/29 09:28:10.218 ZEBRA: [GCEGC-W8YBF]   rtmsg [family=(10) AF_INET6 dstlen=128 srclen=0 tos=0 table=254 protocol=(194) UNKNOWN scope=(0) UNIVERSE type=(1) UNICAST flags=0x0000 {}]
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=20 (payload=16) type=(1) DST]
2021/10/29 09:28:10.218 ZEBRA: [STTSM-27M81]       1::1
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(6) PRIORITY]
2021/10/29 09:28:10.218 ZEBRA: [Z4E9C-GD9EP]       20
2021/10/29 09:28:10.218 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(30) NH_ID]
2021/10/29 09:28:10.218 ZEBRA: [Z4E9C-GD9EP]       9
2021/10/29 09:28:10.218 ZEBRA: [V8KNF-8EXH8] netlink_recv_msg: << netlink message dump [recv]
2021/10/29 09:28:10.218 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=76 type=(2) ERROR flags=(0x0300) {DUMP,(ROOT|REPLACE|CAPPED),(MATCH|EXCLUDE|ACK_TLVS)} seq=9 pid=3539131282]
2021/10/29 09:28:10.218 ZEBRA: [KWP1C-6CSXF]   nlmsgerr [error=(-22) Invalid argument]
2021/10/29 09:28:10.218 ZEBRA: [HSYZM-HV7HF] Extended Error: Gateway can not be a local address
2021/10/29 09:28:10.218 ZEBRA: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Invalid argument, type=RTM_NEWNEXTHOP(104), seq=9, pid=3539131282
2021/10/29 09:28:10.218 ZEBRA: [V8KNF-8EXH8] netlink_recv_msg: << netlink message dump [recv]
2021/10/29 09:28:10.218 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=68 type=(2) ERROR flags=(0x0300) {DUMP,(ROOT|REPLACE|CAPPED),(MATCH|EXCLUDE|ACK_TLVS)} seq=10 pid=3539131282]
2021/10/29 09:28:10.218 ZEBRA: [KWP1C-6CSXF]   nlmsgerr [error=(-22) Invalid argument]
2021/10/29 09:28:10.218 ZEBRA: [HSYZM-HV7HF] Extended Error: Nexthop id does not exist
2021/10/29 09:28:10.218 ZEBRA: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Invalid argument, type=RTM_NEWROUTE(24), seq=10, pid=3539131282
2021/10/29 09:28:10.218 ZEBRA: [VCDW6-A7ZF1] dplane dequeues 2 completed work from provider Kernel
2021/10/29 09:28:10.218 ZEBRA: [JTWAB-1MH4Y] dplane has 2 completed, 0 errors, for zebra main
2021/10/29 09:28:10.218 ZEBRA: [J7K9Z-9M7DT] Nexthop dplane ctx 0x56125390a820, op NH_INSTALL, nexthop ID (9), result FAILURE
2021/10/29 09:28:10.218 ZEBRA: [P2XBZ-RAFQ5][EC 4043309074] Failed to install Nexthop ID (9) into the kernel
2021/10/29 09:28:10.218 ZEBRA: [RMK34-61HV5] default(0:254):1::1/128 Processing dplane result ctx 0x56125390add0, op ROUTE_INSTALL result FAILURE

Note the last line `op ROUTE_INSTALL result FAILURE` because we are attempting to use a
a gw nexthop that is local.  This is the result.

Then the test code was installing the route again:

2021/10/29 09:30:00.493 ZEBRA: [JGWSB-SMNVE] dplane: incoming new work counter: 2
2021/10/29 09:30:00.493 ZEBRA: [Q52A7-211QJ] dplane enqueues 2 new work to provider 'Kernel'
2021/10/29 09:30:00.493 ZEBRA: [JVY1P-93VFY] dplane provider 'Kernel': processing
2021/10/29 09:30:00.493 ZEBRA: [TX9N0-9JKDF] ID (9) Dplane nexthop update ctx 0x561253916a00 op NH_INSTALL
2021/10/29 09:30:00.493 ZEBRA: [PM9ZJ-07RCP] 0:1::1/128 Dplane route update ctx 0x561253915f40 op ROUTE_UPDATE
2021/10/29 09:30:00.493 ZEBRA: [TJ327-ET8HE] netlink_send_msg: >> netlink message dump [sent]
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=104 type=(104) NEWNEXTHOP flags=(0x0501) {REQUEST,DUMP,(ROOT|REPLACE|CAPPED),(ATOMIC|CREATE)} seq=11 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [WCX94-SW894]   nhm [family=(10) AF_INET6 scope=(0) UNIVERSE protocol=(11) ZEBRA flags=0x00000000 {}]
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(1) ID]
2021/10/29 09:30:00.493 ZEBRA: [Z4E9C-GD9EP]       9
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=20 (payload=16) type=(6) GATEWAY]
2021/10/29 09:30:00.493 ZEBRA: [STTSM-27M81]       2001::1
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(5) OIF]
2021/10/29 09:30:00.493 ZEBRA: [JR4EA-BKPTA]       6
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=6 (payload=2) type=(7) ENCAP_TYPE]
2021/10/29 09:30:00.493 ZEBRA: [JR4EA-BKPTA]       5
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=36 (payload=32) type=(32776) UNKNOWN]
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=56 type=(25) DELROUTE flags=(0x0401) {REQUEST,(ATOMIC|CREATE)} seq=13 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [GCEGC-W8YBF]   rtmsg [family=(10) AF_INET6 dstlen=128 srclen=0 tos=0 table=254 protocol=(194) UNKNOWN scope=(0) UNIVERSE type=(0) UNSPEC flags=0x0000 {}]
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=20 (payload=16) type=(1) DST]
2021/10/29 09:30:00.493 ZEBRA: [STTSM-27M81]       1::1
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(6) PRIORITY]
2021/10/29 09:30:00.493 ZEBRA: [Z4E9C-GD9EP]       20
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=64 type=(24) NEWROUTE flags=(0x0401) {REQUEST,(ATOMIC|CREATE)} seq=12 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [GCEGC-W8YBF]   rtmsg [family=(10) AF_INET6 dstlen=128 srclen=0 tos=0 table=254 protocol=(194) UNKNOWN scope=(0) UNIVERSE type=(1) UNICAST flags=0x0000 {}]
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=20 (payload=16) type=(1) DST]
2021/10/29 09:30:00.493 ZEBRA: [STTSM-27M81]       1::1
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(6) PRIORITY]
2021/10/29 09:30:00.493 ZEBRA: [Z4E9C-GD9EP]       20
2021/10/29 09:30:00.493 ZEBRA: [KFBSR-XYJV1]     rta [len=8 (payload=4) type=(30) NH_ID]
2021/10/29 09:30:00.493 ZEBRA: [Z4E9C-GD9EP]       9
2021/10/29 09:30:00.493 ZEBRA: [V8KNF-8EXH8] netlink_recv_msg: << netlink message dump [recv]
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=76 type=(2) ERROR flags=(0x0300) {DUMP,(ROOT|REPLACE|CAPPED),(MATCH|EXCLUDE|ACK_TLVS)} seq=11 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [KWP1C-6CSXF]   nlmsgerr [error=(-22) Invalid argument]
2021/10/29 09:30:00.493 ZEBRA: [HSYZM-HV7HF] Extended Error: Gateway can not be a local address
2021/10/29 09:30:00.493 ZEBRA: [WVJCK-PPMGD][EC 4043309093] netlink-dp (NS 0) error: Invalid argument, type=RTM_NEWNEXTHOP(104), seq=11, pid=3539131282
2021/10/29 09:30:00.493 ZEBRA: [V8KNF-8EXH8] netlink_recv_msg: << netlink message dump [recv]
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=36 type=(2) ERROR flags=(0x0100) {DUMP,(ROOT|REPLACE|CAPPED)} seq=13 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [KWP1C-6CSXF]   nlmsgerr [error=(-3) No such process]
2021/10/29 09:30:00.493 ZEBRA: [V8KNF-8EXH8] netlink_recv_msg: << netlink message dump [recv]
2021/10/29 09:30:00.493 ZEBRA: [JAS4D-NCWGP] nlmsghdr [len=68 type=(2) ERROR flags=(0x0300) {DUMP,(ROOT|REPLACE|CAPPED),(MATCH|EXCLUDE|ACK_TLVS)} seq=12 pid=3539131282]
2021/10/29 09:30:00.493 ZEBRA: [KWP1C-6CSXF]   nlmsgerr [error=(-22) Invalid argument]
2021/10/29 09:30:00.493 ZEBRA: [VCDW6-A7ZF1] dplane dequeues 2 completed work from provider Kernel
2021/10/29 09:30:00.493 ZEBRA: [JTWAB-1MH4Y] dplane has 2 completed, 0 errors, for zebra main
2021/10/29 09:30:00.493 ZEBRA: [J7K9Z-9M7DT] Nexthop dplane ctx 0x561253916a00, op NH_INSTALL, nexthop ID (9), result FAILURE
2021/10/29 09:30:00.493 ZEBRA: [P2XBZ-RAFQ5][EC 4043309074] Failed to install Nexthop ID (9) into the kernel
2021/10/29 09:30:00.493 ZEBRA: [RMK34-61HV5] default(0:254):1::1/128 Processing dplane result ctx 0x561253915f40, op ROUTE_UPDATE result SUCCESS

Note that this time we do these three operations

a) nexthop installation seq 11
b) route delete seq 13
c) route add seq 12

Note the last line, we report the install as a success but it clearly failed from the seq=12 decode.
When we look at the v6 rib it thinks it is installed:

unet> r1 show ipv6 route
Codes: K - kernel route, C - connected, S - static, R - RIPng,
       O - OSPFv3, I - IS-IS, B - BGP, N - NHRP, T - Table,
       v - VNC, V - VNC-Direct, A - Babel, D - SHARP, F - PBR,
       f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

D>* 1::1/128 [150/0] via 2001::1, dum0, seg6local unspec unknown(seg6local_context2str), seg6 a::, weight 1, 00:00:17

So let's modify nl_batch_read_resp to not dequeue/enqueue the context until we are sure we have
the right one.  This fixes the test code to do the right thing on the second installation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: set zd_is_update in 1 spot
Donald Sharp [Wed, 10 Nov 2021 20:09:37 +0000 (15:09 -0500)]
zebra: set zd_is_update in 1 spot

The ctx->zd_is_update is being set in various
spots based upon the same value that we are
passing into dplane_ctx_ns_init.  Let's just
consolidate all this into the dplane_ctx_ns_init
so that the zd_is_udpate value is set at the
same time that we increment the sequence numbers
to use.

As a note for future me's reading this.  The sequence
number choosen for the seq number passed to the
kernel is that each context gets a copy of the
appropriate nlsock to use.  Since it's a copy
at a point in time, we know we have a unique sequence
number value.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: When we get an implicit or ack or full failure mark status
Donald Sharp [Wed, 10 Nov 2021 19:12:39 +0000 (14:12 -0500)]
zebra: When we get an implicit or ack or full failure mark status

When nl_batch_read_resp gets a full on failure -1 or an implicit
ack 0 from the kernel for a batch of code.  Let's immediately
mark all of those in the batch pass/fail as needed.  Instead
of having them marked else where.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10161 from donaldsharp/hash_crash
Jafar Al-Gharaibeh [Fri, 4 Feb 2022 20:18:03 +0000 (14:18 -0600)]
Merge pull request #10161 from donaldsharp/hash_crash

zebra: Fix improper usage of hash_iterate that caused crashes

2 years agolib: Update hash.h documentation to warn of a possible crash
Donald Sharp [Wed, 1 Dec 2021 22:03:38 +0000 (17:03 -0500)]
lib: Update hash.h documentation to warn of a possible crash

Multiple deletions from the hash_walk or hash_iteration calls
during a single invocation of the passed in function can and
will cause the program to crash.  Warn against doing such a
thing.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Ensure zebra_nhg_sweep_table accounts for double deletes
Donald Sharp [Wed, 1 Dec 2021 21:28:42 +0000 (16:28 -0500)]
zebra: Ensure zebra_nhg_sweep_table accounts for double deletes

I'm seeing this crash in various forms:
Program terminated with signal SIGSEGV, Segmentation fault.
50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f418efbc7c0 (LWP 3580253))]
(gdb) bt
(gdb) f 4
267 (*func)(hb, arg);
(gdb) p hb
$1 = (struct hash_bucket *) 0x558cdaafb250
(gdb) p *hb
$2 = {len = 0, next = 0x0, key = 0, data = 0x0}
(gdb)

I've also seen a crash where data is 0x03.

My suspicion is that hash_iterate is calling zebra_nhg_sweep_entry which
does delete the particular entry we are looking at as well as possibly other
entries when the ref count for those entries gets set to 0 as well.

Then we have this loop in hash_iterate.c:

   for (i = 0; i < hash->size; i++)
            for (hb = hash->index[i]; hb; hb = hbnext) {
                    /* get pointer to next hash bucket here, in case (*func)
                     * decides to delete hb by calling hash_release
                     */
                    hbnext = hb->next;
                    (*func)(hb, arg);
            }
Suppose in the previous loop hbnext is set to hb->next and we call
zebra_nhg_sweep_entry. This deletes the previous entry and also
happens to cause the hbnext entry to be deleted as well, because of nhg
refcounts. At this point in time the memory pointed to by hbnext is
not owned by the pthread anymore and we can end up on a state where
it's overwritten by another pthread in zebra with data for other incoming events.

What to do?  Let's change the sweep function to a hash_walk and have
it stop iterating and to start over if there is a possible double
delete operation.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopim: Use INADDR_ANY for current_bsr checking is valid yet
Donald Sharp [Fri, 4 Feb 2022 13:49:39 +0000 (08:49 -0500)]
pim: Use INADDR_ANY for current_bsr checking is valid yet

In all places that pim_nht_bsr_del is called, the code
needs to not unregister if the current_bsr is INADDR_ANY.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10401 from donaldsharp/donot_agree
Russ White [Fri, 4 Feb 2022 15:55:00 +0000 (10:55 -0500)]
Merge pull request #10401 from donaldsharp/donot_agree

zebra: Make Router Advertisement warnings show up once every 6 hours

2 years agopimd: Only remove bsr NHT if we actually have tracked something
Donald Sharp [Fri, 28 Jan 2022 16:17:53 +0000 (11:17 -0500)]
pimd: Only remove bsr NHT if we actually have tracked something

I'm now seeing in my log file:

2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:05 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0
2022/01/28 11:20:06 PIM: [Q0PZ7-QBBN3] attempting to delete nonexistent NHT BSR entry 0.0.0.0

When I run pimd.  Looking at the code there are 3 places where pim_bsm.c removes the
NHT BSR tracking.  In 2 of them the code ensures that the address is already setup
in 1 place it is not.  Fix.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10469 from mjstapp/fix_dplane_netlink_groups
Donatas Abraitis [Fri, 4 Feb 2022 15:51:31 +0000 (17:51 +0200)]
Merge pull request #10469 from mjstapp/fix_dplane_netlink_groups

zebra: reduce incoming netlink messages for dplane thread

2 years agodoc: Update `show zebra` command
Donald Sharp [Fri, 4 Feb 2022 13:44:36 +0000 (08:44 -0500)]
doc: Update `show zebra` command

Update the `show zebra` command documentation to
show what it is doing now.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Convert some `show zebra` output to a table
Donald Sharp [Fri, 4 Feb 2022 13:42:07 +0000 (08:42 -0500)]
zebra: Convert some `show zebra` output to a table

Make the output a bit easier to interpret and use by
converting to usage of a table.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add knowledge about RA and RFC 5549 to `show zebra`
Donald Sharp [Fri, 4 Feb 2022 13:04:23 +0000 (08:04 -0500)]
zebra: Add knowledge about RA and RFC 5549 to `show zebra`

Add to `show zebra` whether or not RA is compiled into FRR
and whether or not BGP is using RFC 5549 at the moment.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add evpn status to `show zebra`
Donald Sharp [Sat, 22 Jan 2022 13:31:50 +0000 (08:31 -0500)]
zebra: Add evpn status to `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add os and version to `show zebra`
Donald Sharp [Sat, 22 Jan 2022 13:21:34 +0000 (08:21 -0500)]
zebra: Add os and version to `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add kernel nexthop group support to `show zebra`
Donald Sharp [Sat, 22 Jan 2022 12:53:24 +0000 (07:53 -0500)]
zebra: Add kernel nexthop group support to `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add MPLS status to `show zebra`
Donald Sharp [Fri, 21 Jan 2022 18:20:17 +0000 (13:20 -0500)]
zebra: Add MPLS status to `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add if v4/v6 forwarding is turned on/off to `show zebra`
Donald Sharp [Fri, 21 Jan 2022 18:14:39 +0000 (13:14 -0500)]
zebra: Add if v4/v6 forwarding is turned on/off to `show zebra`

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add to `show zebra` the type of vrf devices being used
Donald Sharp [Fri, 21 Jan 2022 18:05:35 +0000 (13:05 -0500)]
zebra: Add to `show zebra` the type of vrf devices being used

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Add ability to know when FRR is not asic offloaded
Donald Sharp [Fri, 21 Jan 2022 17:51:11 +0000 (12:51 -0500)]
zebra: Add ability to know when FRR is not asic offloaded

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Add more information to `show version`
Donald Sharp [Sat, 22 Jan 2022 13:15:42 +0000 (08:15 -0500)]
lib: Add more information to `show version`

Add to lib/command.c the ability to remember the
release/version/system information and to allow
`show version` to dump some of it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Prevent use after variable goes out of scope
Donald Sharp [Mon, 24 Jan 2022 12:02:37 +0000 (07:02 -0500)]
bgpd: Prevent use after variable goes out of scope

`struct prefix p` was declared inside an if statement
where we assign the address of to a pointer that is
then passed to a sub function.  This will eventually
leave us in a bad state.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Use bgp_attr_[sg]et_ecommunity for struct ecommunity
Donatas Abraitis [Fri, 4 Feb 2022 13:56:20 +0000 (15:56 +0200)]
bgpd: Use bgp_attr_[sg]et_ecommunity for struct ecommunity

This is an extra work before moving attr->ecommunity to attra_extra struct.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10495 from anlancs/doc-ospf-range
Igor Ryzhov [Fri, 4 Feb 2022 12:28:38 +0000 (15:28 +0300)]
Merge pull request #10495 from anlancs/doc-ospf-range

doc: complete area id for ospf's "range" command

2 years agoMerge pull request #10473 from tlsalmin/master
Igor Ryzhov [Fri, 4 Feb 2022 12:23:20 +0000 (15:23 +0300)]
Merge pull request #10473 from tlsalmin/master

ospfd: Core in ospf_if_down during shutdown.

2 years agoospfd: Core in ospf_if_down during shutdown.
Tomi Salminen [Wed, 2 Feb 2022 09:19:09 +0000 (11:19 +0200)]
ospfd: Core in ospf_if_down during shutdown.

Skip marking routes as changed in ospf_if_down if there's now
new_table present, which might be the case when the instance is
being finished

The backtrace for the core was:

  raise (sig=sig@entry=11) at ../sysdeps/unix/sysv/linux/raise.c:50
  core_handler (signo=11, siginfo=0x7fffffffe170, context=<optimized out>) at lib/sigevent.c:262
  <signal handler called>
  route_top (table=0x0) at lib/table.c:401
  ospf_if_down (oi=oi@entry=0x555555999090) at ospfd/ospf_interface.c:849
  ospf_if_free (oi=0x555555999090) at ospfd/ospf_interface.c:339
  ospf_finish_final (ospf=0x55555599c830) at ospfd/ospfd.c:749
  ospf_deferred_shutdown_finish (ospf=0x55555599c830) at ospfd/ospfd.c:578
  ospf_deferred_shutdown_check (ospf=<optimized out>) at ospfd/ospfd.c:627
  ospf_finish (ospf=<optimized out>) at ospfd/ospfd.c:683
  ospf_terminate () at ospfd/ospfd.c:653
  sigint () at ospfd/ospf_main.c:109
  quagga_sigevent_process () at lib/sigevent.c:130
  thread_fetch (m=m@entry=0x5555556e45e0, fetch=fetch@entry=0x7fffffffe9b0) at lib/thread.c:1709
  frr_run (master=0x5555556e45e0) at lib/libfrr.c:1174
  main (argc=9, argv=0x7fffffffecb8) at ospfd/ospf_main.c:254

Signed-off-by: Tomi Salminen <tsalminen@forcepoint.com>
2 years agodoc: complete area id for ospf's "range" command
anlan_cs [Fri, 4 Feb 2022 02:09:45 +0000 (10:09 +0800)]
doc: complete area id for ospf's "range" command

Like other commands, just complete area id.
Additonally replace `IPV4_PREFIX` with generic `A.B.C.D/M`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #10481 from mobash-rasool/pim-doc
Donatas Abraitis [Thu, 3 Feb 2022 06:47:45 +0000 (08:47 +0200)]
Merge pull request #10481 from mobash-rasool/pim-doc

doc: Correcting the documentation for pimd

2 years agoMerge pull request #10485 from qlyoung/strnccncncncncmppp
Donatas Abraitis [Thu, 3 Feb 2022 06:01:56 +0000 (08:01 +0200)]
Merge pull request #10485 from qlyoung/strnccncncncncmppp

bgpd: strncmp -> strcmp in community hash foo

2 years agobgpd: strncmp -> strcmp in community hash foo
Quentin Young [Wed, 2 Feb 2022 21:34:03 +0000 (16:34 -0500)]
bgpd: strncmp -> strcmp in community hash foo

buffers are null terminated

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2 years agodebian, redhat: updating changelog for new release
Donatas Abraitis [Tue, 1 Feb 2022 20:00:33 +0000 (22:00 +0200)]
debian, redhat: updating changelog for new release

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: Correcting the documentation for pimd
Mobashshera Rasool [Wed, 2 Feb 2022 18:07:34 +0000 (10:07 -0800)]
doc: Correcting the documentation for pimd

While going through the doc, found some commands are missing in the doc.
Also correcting few mistakes.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agotests: Add CSPF topotest
Olivier Dugeon [Wed, 2 Feb 2022 15:56:30 +0000 (16:56 +0100)]
tests: Add CSPF topotest

Add new topotest for the Constraints ShortestPath First (CSPF) algorithm.
This topotest uses IS-IS-TE as base network to populate a Traffic Engineering
Database (TED) and sharpd to call cspf algorithms on this IS-IS-TE topology.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agosharpd: Add call to CSPF
Olivier Dugeon [Fri, 21 Jan 2022 18:02:35 +0000 (19:02 +0100)]
sharpd: Add call to CSPF

New Constaint Shortest Path First algorithm has been introduce in FRR library.
Add a new 'show sharp cspf' command as example of how to use these
CSPF algorithm.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agolib: Add CSPF Path Computation algorithm
Olivier Dugeon [Thu, 13 Jan 2022 09:15:51 +0000 (10:15 +0100)]
lib: Add CSPF Path Computation algorithm

As helper function of Segment Routing Flex Algo or RSVP-TE
add Constrained Shortest Path First algorithm able to compute
path with constraints. Supported constraints are as follow:
 - Standard IGP metric
 - TE IGP metric
 - Delay metric
 - Bandwidth for given Class of Service for bandwidth reservation (RSVP-TE)

Usage of CSPF algorithms is detailed in the doc/developer/cspf.rst file

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agoisisd: Fixup IS-IS-TE bug
Olivier Dugeon [Wed, 2 Feb 2022 15:55:36 +0000 (16:55 +0100)]
isisd: Fixup IS-IS-TE bug

Default metric is not correctly propagated to Link State client due to a
missing flag on Link State Attributes. This patch correct the problem.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agolib: Correct bug for TE metric wrong assignement
Olivier Dugeon [Mon, 24 Jan 2022 16:09:29 +0000 (17:09 +0100)]
lib: Correct bug for TE metric wrong assignement

When link-param is enabled for a given interface, TE metric is automatically
assigned to the metric of the interface. However, the metric of the interface
could be unassigned and keep the default value equal to 0. Thus, if the TE
metric is not explicitely modified within the `link-param metric` statement,
TE metric remains set to 0 which is not a valid value especially when
computing constrainted path.

This patch changes the assignement of the default value of the TE metric.
It is set to the metric of the interface only if the latter is not equal to 0.
TE topotests for OSPF and IS-IS have been adjusted accordingly.

Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2 years agobgpd: Pass struct pfx_record to sizeof
Donatas Abraitis [Wed, 2 Feb 2022 11:30:52 +0000 (13:30 +0200)]
bgpd: Pass struct pfx_record to sizeof

Passing argument "&rec" of type "struct pfx_record *" and argument
"1UL" to function "read" is suspicious because
"sizeof (struct pfx_record) /*40*/" is expected.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10409 from idryzhov/zebra-mq-clean-crash
Mark Stapp [Wed, 2 Feb 2022 13:35:00 +0000 (08:35 -0500)]
Merge pull request #10409 from idryzhov/zebra-mq-clean-crash

zebra: fix cleanup of meta queues on vrf disable

2 years agobgpd: Do not check for status from str2sockunion()
Donatas Abraitis [Wed, 2 Feb 2022 11:28:26 +0000 (13:28 +0200)]
bgpd: Do not check for status from str2sockunion()

Coverity pass.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10388 from anlancs/bfd-fsm-passive
Igor Ryzhov [Wed, 2 Feb 2022 10:06:11 +0000 (13:06 +0300)]
Merge pull request #10388 from anlancs/bfd-fsm-passive

bfdd: fix broken FSM in passive mode

2 years agobfdd: fix broken FSM in passive mode
anlan_cs [Wed, 19 Jan 2022 07:10:18 +0000 (02:10 -0500)]
bfdd: fix broken FSM in passive mode

Problem:
One is with active mode, the other is with passive mode. Sometimes
the one with active mode is in `Down` stauts, but the other one
with passive mode is unluckily stuck in `Init` status:
It doesn't answer its peer with any packets, even receiving continuous
`Down` packets.

Root Cause:
bfdd with passive mode answers its peer only *one* packet in `Down` status,
then it enters into `Init` status and ignores subsequent `Down` packets.
Unluckily that *one* answered packet is lost, at that moment its peer
with active mode can only have to send `Down` packets.

Fix:
1) With passive mode, bfdd should start xmittimer after received `Down` packet.
Refer to RFC5880:
"A system taking the Passive role MUST NOT begin sending BFD packets for
a particular session until it has received a BFD packet for that session, and
thus has learned the remote system's discriminator value."

2) Currently this added xmittimer for passive mode can be safely removed
except receiving `AdminDown` packet:
    - `bfd_session_enable/bfd_set_passive_mode` doesn't start xmittimer
    - `ptm_bfd_sess_dn/bfd_set_shutdown` can remove xmittimer
Per RFC5880, receiving `AdminDown` packet should be also regarded as `Down`,
so just call `ptm_bfd_sess_dn`, which will safely remove the added xmittimer
for passive mode. In summary, call `ptm_bfd_sess_dn` for two status changes
on receiving `AdminDown`: `Init`->`Down` and `Up`->`Down`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agozebra: reduce incoming netlink messages for dplane thread
Mark Stapp [Tue, 1 Feb 2022 18:41:17 +0000 (13:41 -0500)]
zebra: reduce incoming netlink messages for dplane thread

The dataplane pthread only processes a limited set of incoming
netlink notifications: only register for that set of events,
reducing duplicate incoming netlink messages.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10464 from pguibert6WIND/negogiate
Mark Stapp [Tue, 1 Feb 2022 18:00:54 +0000 (13:00 -0500)]
Merge pull request #10464 from pguibert6WIND/negogiate

topotests: fix typo about bgp_dont_capability folder name

2 years agoMerge pull request #10428 from ton31337/fix/attr_extra_ipv6_ecommunity
Russ White [Tue, 1 Feb 2022 16:38:39 +0000 (11:38 -0500)]
Merge pull request #10428 from ton31337/fix/attr_extra_ipv6_ecommunity

bgpd: Move out ipv6_ecommunity struct from attr to attr_extra

2 years agoMerge pull request #10413 from anlancs/bfd-with-check
Russ White [Tue, 1 Feb 2022 16:18:52 +0000 (11:18 -0500)]
Merge pull request #10413 from anlancs/bfd-with-check

bfdd,doc,yang: a few minor commits for bfdd

2 years agoMerge pull request #10373 from anlancs/ospf-add-asbr
Igor Ryzhov [Tue, 1 Feb 2022 16:04:33 +0000 (19:04 +0300)]
Merge pull request #10373 from anlancs/ospf-add-asbr

ospfd: fix missing "aggregation timer" in running configuration

2 years agoMerge pull request #10391 from gromit1811/bug_9720_ecmp_inter_area_topotest_3paths
Russ White [Tue, 1 Feb 2022 15:55:13 +0000 (10:55 -0500)]
Merge pull request #10391 from gromit1811/bug_9720_ecmp_inter_area_topotest_3paths

tests: Topotest for checking ECMP inter-area nexthop handling