]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 years agodocker: use Alpine-provided libyang 11641/head
Quentin Young [Sun, 17 Jul 2022 23:10:45 +0000 (19:10 -0400)]
docker: use Alpine-provided libyang

looks like libyang(2) is back in the upstream alpine repos, so we can
use that instead

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit 0bbc787cd3714d4e2521e969bf67b93462321c0f)

2 years agoalpine, docker: Update APKBUILD for libyang
Quentin Young [Sun, 17 Jul 2022 21:37:14 +0000 (17:37 -0400)]
alpine, docker: Update APKBUILD for libyang

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
(cherry picked from commit d782b117d0d00d7177b438c5ebdae7bd8f8b07b1)

2 years agoFRR Release 8.3
Jafar Al-Gharaibeh [Sun, 17 Jul 2022 04:27:53 +0000 (23:27 -0500)]
FRR Release 8.3

Changelog
---------

**General**
   - Add camelcase json keys in addition to pascalcase (Wrong JSON keys will be depracated)
   - Fix corruption when route-map delete/add sequence happens (fast re-add)
   - Reworked gRPC
   - RFC5424 & journald extended syslog target

**bfdd**
   - Fix broken FSM in active/passive modes

**bgpd**
   - Notification Message Support for BGP Graceful Restart (rfc8538)
   - BGP Cease Notification Subcode For BFD
   - Send Hold Timer for BGP (own implementation without an additional knob)
   - New `set as-path replace` command for BGP route-map
   - New `match peer` command for BGP route-map
   - New `ead-es-frag evi-limit` command for EVPN
   - New `match evpn route-type` command for EVPN route-map to match Type-1/Type-4
   - JSON outputs for all RPKI show commands
   - Set attributes via route-map for BGP conditional advertisements
   - Pass non-transitive extended communities between RS and RS-clients
   - Send MED attribute when aggregate prefix is created
   - Require librtr >= 0.8.0 for RPKI to fix connection handling (failover)
   - Fix aspath memory leak in aggr_suppress_map_test
   - Fix crash for `show ip bgp vrf all all neighbors 192.168.0.1 ...`
   - Fix crash for `show ip bgp vrf all all`
   - Fix memory leak for BGP Community Alias in CLI
   - Fix memory leak when setting BGP community at egress
   - Fix memory leak when setting BGP large-community at egress
   - Fix SR color nexthop processing in BGP
   - Fix setting local-preference in route-map using +/-
   - Fix crash using Lua and route-map to set attributes via scripts
   - Fix crash when issuing various forms of `bgp no-rib`

**isisd**
   - JSON output for show summary command
   - Fix crash when MTU mismatch occurs
   - Fix crash with xfrm interface type
   - Fix infinite loop when parsing LSPs
   - Fix router capability TLV parsing issues

**vtysh**
   - New `show thread timers` command

**ospfd6**
   - Add LSA statistics to LSA database
   - Add LSA stats to `show area json` output
   - Show time left in hello timer for `show ipv6 ospf6 int`
   - Permit route deletion without nexthops
   - Restart SPF when distance is updated
   - Stop refreshing Type-5 from NSSA
   - Support keychain for ospf6 authentication

**ospfd**
   - New `show ip ospf reachable-routers` command
   - Restart SPF when distance is updated
   - Use consistent JSON keys for `show ip ospf neighbor` and detail version

**pimd**
   - Add additional IGMP stats
   - Add IGMP join sent/failed statistics
   - Add IGMP total groups and total source groups to statistics
   - New `debug igmp trace detail` command
   - New `ip pim passive` command
   - JSON support added for command `show ip igmp sources`
   - Allow the LPM match work properly with prefix lists and normal RP's
   - Do not allow 224.0.0.0/24 range in IGMP join
   - Fix IGMP packet/query check
   - Handle PIM join/prune receive flow for IPv6
   - Handle receive of (*,G) register stop with source address as 0
   - Handle of exclude mode IGMPv3 report messages for SSM-aware group
   - Handle of IGMPv2 report message for SSM-aware group range
   - Send immediate join with possible sg rpt prune bit set
   - Show group-type under `show ip pim rp-info`
   - Show total received messages IGMP stats

**staticd**
   - Capture zebra's advertised ECMP limit
   - Don't register existing nexthop to Zebra
   - Reject route config with too many nexthops
   - Track nexthops per-safi

**watchfrr**
   - Add some more information to `show watchfrr`
   - Send operational state to systemd

**zebra**
   - Add ability to know when FRR is not ASIC offloaded
   - Add command for setting protodown bit
   - Add dplane type for netconf data
   - Add ECMP supported to `show zebra`
   - Add EVPN status to `show zebra`
   - Add if v4/v6 forwarding is turned on/off to `show zebra`
   - Add initial zebra tracepoint support
   - Add kernel nexthop group support to `show zebra`
   - Add knowledge about ra and rfc 5549 to `show zebra`
   - Add mpls status to `show zebra`
   - Add netlink debug dump for netconf messages
   - Add netlink debugs for ip rules
   - Add OS and version to `show zebra`
   - Add support for end.dt4
   - Add to `show zebra` the type of vrf devices being used
   - Allow *BSD to specify a receive buffer size
   - Allow multiple connected routes to be choosen for kernel routes
   - Allow system routes to recurse through themselves
   - Don't send RAs w/o link-local v6 or on bridge-ports
   - Evpn disable remove l2vni from l3vni list
   - Evpn-mh bonds protodown check for set
   - Evpn-mh use protodown update reason api
   - Fix cleanup of meta queues on vrf disable
   - Fix crash in evpn neigh cleanup all
   - Fix missing delete vtep during vni transition
   - Fix missing vrf change of l2vni on vxlan interface
   - Fix rtadv startup when config read in is before interface up
   - Fix use after deletion event in FreeBSD
   - Fix v6 route replace failure turned into success
   - Get zebra graceful restart working when restarting on *BSD
   - Handle FreeBSD routing socket enobufs
   - Handle protodown netlink for vxlan device
   - Include mpls enabled status in interface output
   - Include old reason in evpn-mh bond update
   - Keep the interface flags safe on multiple ioctl calls
   - Let /32 host route with same ip cross vrf
   - Make router advertisement warnings show up once every 6 hours
   - Prevent crash if zebra_route_all is used for a route type
   - Prevent installation of connected multiple times
   - Protodown-up event trigger interface up
   - Register nht nexthops with proper safi
   - Update advertise-svi-ip macips w/ new mac
   - When handling unprocessed messages from kernel print usable string
   - New `show ip nht mrib` command
   - Handle ENOBUFS errors for FreeBSD

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agodebian, redhat: updating changelog for new release
Jafar Al-Gharaibeh [Sun, 17 Jul 2022 04:27:20 +0000 (23:27 -0500)]
debian, redhat: updating changelog for new release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2 years agoMerge pull request #11619 from FRRouting/mergify/bp/stable/8.3/pr-11604
Donald Sharp [Sun, 17 Jul 2022 00:58:32 +0000 (20:58 -0400)]
Merge pull request #11619 from FRRouting/mergify/bp/stable/8.3/pr-11604

ospfd: free unreachable router LSA node so that it is not left unreachable (backport #11604)

2 years agoMerge pull request #11620 from FRRouting/mergify/bp/stable/8.3/pr-11615
Donald Sharp [Sun, 17 Jul 2022 00:56:38 +0000 (20:56 -0400)]
Merge pull request #11620 from FRRouting/mergify/bp/stable/8.3/pr-11615

bgpd: Fix memory leak for community stuff (backport #11615)

2 years agoMerge pull request #11616 from FRRouting/mergify/bp/stable/8.3/pr-11614
Donald Sharp [Sun, 17 Jul 2022 00:56:12 +0000 (20:56 -0400)]
Merge pull request #11616 from FRRouting/mergify/bp/stable/8.3/pr-11614

bgpd: Fix memory leak for community alias (backport #11614)

2 years agobgpd: Fix memory leak for community stuff 11620/head
Donatas Abraitis [Sat, 16 Jul 2022 13:26:13 +0000 (16:26 +0300)]
bgpd: Fix memory leak for community stuff

Do not forget to cleanup after we are done:

==395247== 8,268 (32 direct, 8,236 indirect) bytes in 1 blocks are definitely lost in loss record 199 of 205
==395247==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==395247==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1FBF63: community_intern (in /usr/lib/frr/bgpd)
==395247==    by 0x1FC0C5: community_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x1F0B66: bgp_attr_community (in /usr/lib/frr/bgpd)
==395247==    by 0x1F4185: bgp_attr_parse (in /usr/lib/frr/bgpd)
==395247==    by 0x26BC29: bgp_update_receive (in /usr/lib/frr/bgpd)
==395247==    by 0x26E887: bgp_process_packet (in /usr/lib/frr/bgpd)
==395247==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==395247==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 9571a61a12c063a5c8ae2b05d5ec189eb84f18d6)

2 years agoospfd: free unreachable router LSA node so that it is not left unreachable 11619/head
Lou Berger [Thu, 14 Jul 2022 11:40:39 +0000 (07:40 -0400)]
ospfd: free unreachable router LSA node so that it is not left unreachable

       allows for an LSA to be unreachable via one link and reachable via another

Signed-off-by: Lou Berger <lberger@labn.net>
(cherry picked from commit b976af1b093faf2723257a185070c48cb5de6813)

2 years agobgpd: Fix memory leak for community alias 11616/head
Donatas Abraitis [Sat, 16 Jul 2022 13:18:07 +0000 (16:18 +0300)]
bgpd: Fix memory leak for community alias

==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 94 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD3CC: bgp_ca_alias_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8E5: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==361630==
==361630== 24,780 (96 direct, 24,684 indirect) bytes in 3 blocks are definitely lost in loss record 95 of 97
==361630==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==361630==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x490BB12: hash_get (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1FD39C: bgp_ca_community_insert (in /usr/lib/frr/bgpd)
==361630==    by 0x2CF8F4: bgp_community_alias_magic (in /usr/lib/frr/bgpd)
==361630==    by 0x2C980B: bgp_community_alias (in /usr/lib/frr/bgpd)
==361630==    by 0x48E3556: cmd_execute_command_real (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E384B: cmd_execute_command_strict (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3D41: command_config_read_one_line (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x48E3EBA: config_from_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x499065C: vty_read_file (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4990FF4: vty_read_config (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491CB95: frr_config_read_in (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x4985380: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==361630==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 176d7beabc26b4494261d82f656f6b024cbfece4)

2 years agoMerge pull request #11608 from FRRouting/mergify/bp/stable/8.3/pr-11606
Jafar Al-Gharaibeh [Fri, 15 Jul 2022 15:06:55 +0000 (10:06 -0500)]
Merge pull request #11608 from FRRouting/mergify/bp/stable/8.3/pr-11606

zebra: free neighbor state before exit to avoid memleaks (backport #11606)

2 years agozebra: free neighbor state before exit to avoid memleaks 11608/head
Christian Hopps [Thu, 14 Jul 2022 16:20:01 +0000 (12:20 -0400)]
zebra: free neighbor state before exit to avoid memleaks

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 11c9ab3202b2cefca0daca2ca1883e6772524a73)

# Conflicts:
# zebra/zebra_neigh.c

2 years agoMerge pull request #11607 from FRRouting/mergify/bp/stable/8.3/pr-11536
Jafar Al-Gharaibeh [Thu, 14 Jul 2022 20:03:39 +0000 (15:03 -0500)]
Merge pull request #11607 from FRRouting/mergify/bp/stable/8.3/pr-11536

pimd: During prune pending, behave as NOINFO state (conformance issue) (backport #11536)

2 years agopimd: During prune pending, behave as NOINFO state 11607/head
Mobashshera Rasool [Wed, 6 Jul 2022 06:08:52 +0000 (23:08 -0700)]
pimd: During prune pending, behave as NOINFO state

Fixed ANVL Conformance PIM-SM 16.3 test case.

When (S,G,rpt) prune is received, we were installing
the mroute immediately with none as OIF.
This leads to dropping the (S,G) traffic during prune
pending time as well.

Also we should not install the mroute if there is no
change in the rpf update.

These 2 things lead to the failure of the test case.

Fixed it by blocking the installation in this scenario.
When prune pending timer pops, it will take care of
installing the mroute with  none as OIF.

Fixes: #11535
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit 8d0f0b02f3322b13c33fb215cf78ceedc685c950)

2 years agoMerge pull request #11599 from FRRouting/mergify/bp/dev/8.3/pr-11577
Jafar Al-Gharaibeh [Wed, 13 Jul 2022 14:10:09 +0000 (09:10 -0500)]
Merge pull request #11599 from FRRouting/mergify/bp/dev/8.3/pr-11577

bgpd: Free ->raw_data from Hard Notification message after we use it (backport #11577)

2 years agobgpd: Free ->raw_data from Hard Notification message after we use it 11599/head
Donatas Abraitis [Sun, 10 Jul 2022 09:42:46 +0000 (12:42 +0300)]
bgpd: Free ->raw_data from Hard Notification message after we use it

==175785== 0 bytes in 1 blocks are definitely lost in loss record 1 of 88
==175785==    at 0x483DD99: calloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==175785==    by 0x492EB8E: qcalloc (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x269823: bgp_notify_decapsulate_hard_reset (in /usr/lib/frr/bgpd)
==175785==    by 0x26C85D: bgp_notify_receive (in /usr/lib/frr/bgpd)
==175785==    by 0x26E94E: bgp_process_packet (in /usr/lib/frr/bgpd)
==175785==    by 0x4985349: thread_call (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x491D521: frr_run (in /usr/local/lib/libfrr.so.0.0.0)
==175785==    by 0x1EBEE8: main (in /usr/lib/frr/bgpd)
==175785==

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit c73d236383779498034abaa1a759a784750f46da)

2 years agoMerge pull request #11591 from FRRouting/mergify/bp/dev/8.3/pr-11588
Russ White [Tue, 12 Jul 2022 14:10:18 +0000 (10:10 -0400)]
Merge pull request #11591 from FRRouting/mergify/bp/dev/8.3/pr-11588

babeld: Install route to RIB if parse_update_subtlv() is false (backport #11588)

2 years agobabeld: Install route to RIB if parse_update_subtlv() is false 11591/head
Donatas Abraitis [Mon, 11 Jul 2022 17:26:06 +0000 (20:26 +0300)]
babeld: Install route to RIB if parse_update_subtlv() is false

We installed the route only if the type was SUBTLV_MANDATORY.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit d5260dc1231922c713555ab4bc77c0b4d0e8d8e6)

2 years agoMerge pull request #11573 from FRRouting/mergify/bp/dev/8.3/pr-11568
Jafar Al-Gharaibeh [Fri, 8 Jul 2022 22:20:37 +0000 (16:20 -0600)]
Merge pull request #11573 from FRRouting/mergify/bp/dev/8.3/pr-11568

bgpd: fix missing rmac value in debug (backport #11568)

2 years agobgpd: fix missing rmac value in debug 11573/head
anlan_cs [Fri, 8 Jul 2022 04:09:56 +0000 (00:09 -0400)]
bgpd: fix missing rmac value in debug

`attr.rmac` is not set in debug as expected for its wrong place in code.

Just move the debug process (`bgp_debug_zebra(NULL)`) after possible `rmac`
value is set.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 2304139a62c667cad734becc43ace87826be397e)

2 years agoMerge pull request #11561 from FRRouting/mergify/bp/dev/8.3/pr-11545
Donald Sharp [Fri, 8 Jul 2022 14:56:38 +0000 (10:56 -0400)]
Merge pull request #11561 from FRRouting/mergify/bp/dev/8.3/pr-11545

bgpd: Free memory for BMP listeners when deleting BGP instance (backport #11545)

2 years agoMerge pull request #11554 from FRRouting/mergify/bp/dev/8.3/pr-11552
Donald Sharp [Thu, 7 Jul 2022 20:26:40 +0000 (16:26 -0400)]
Merge pull request #11554 from FRRouting/mergify/bp/dev/8.3/pr-11552

Package build fixes (backport #11552)

2 years agoMerge pull request #11557 from FRRouting/mergify/bp/dev/8.3/pr-11549
Donald Sharp [Thu, 7 Jul 2022 20:25:30 +0000 (16:25 -0400)]
Merge pull request #11557 from FRRouting/mergify/bp/dev/8.3/pr-11549

tools: Add missing bfdd to logrotate config (backport #11549)

2 years agobgpd: Free memory for BMP listeners when deleting BGP instance 11561/head
Donatas Abraitis [Wed, 6 Jul 2022 14:26:05 +0000 (17:26 +0300)]
bgpd: Free memory for BMP listeners when deleting BGP instance

When using `no router bgp` we MUST free the memory for the listeners too.

Replicate with:
```
router bgp 100
bmp targets server1
bmp listener 0.0.0.0 port 65535
no router bgp
router bgp 100
bmp targets server1
bmp listener 0.0.0.0 port 65535
no router bgp
router bgp 100
bmp targets server1
bmp listener 0.0.0.0 port 65535
no router bgp
```

Before:
```
Type                          : Current#   Size       Total     Max#  MaxBytes
BMP targets                   :        0    240           0        1       248
BMP targets name              :        0      8           0        1        24
BMP listener                  :       12    152        1824       12      1824
BMP instance state            :        0     88           0        1        88
```

After:
```
Type                          : Current#   Size       Total     Max#  MaxBytes
BMP targets                   :        0    240           0        1       248
BMP targets name              :        0      8           0        1        24
BMP listener                  :        0    152           0        1       152
BMP instance state            :        0     88           0        1        88
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 5cb3a15300749a0bdc0eb391c822ee2473f0caec)

2 years agotools: Add missing bfdd to logrotate config 11557/head
Donatas Abraitis [Thu, 7 Jul 2022 06:49:21 +0000 (09:49 +0300)]
tools: Add missing bfdd to logrotate config

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 97634742788475cd4a8581f8d37e29ffa2e6280b)

2 years agoMerge pull request #11550 from FRRouting/mergify/bp/dev/8.3/pr-11548
Jafar Al-Gharaibeh [Thu, 7 Jul 2022 14:55:58 +0000 (08:55 -0600)]
Merge pull request #11550 from FRRouting/mergify/bp/dev/8.3/pr-11548

lib: check hostname in resolver_resolve (backport #11548)

2 years agosnapcraft: Version must be quoted in snap store 11554/head
Martin Winter [Thu, 7 Jul 2022 10:10:54 +0000 (12:10 +0200)]
snapcraft: Version must be quoted in snap store

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit d2b48927bb885611c46bd377a7f649847185ac07)

2 years agodebian: Fix version requirement for rtrlib to allow distro specific names
Martin Winter [Thu, 7 Jul 2022 09:19:34 +0000 (11:19 +0200)]
debian: Fix version requirement for rtrlib to allow distro specific names

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
(cherry picked from commit b78535682c4cd3d7e24b526fd4a2e222683f0b16)

2 years agolib: check hostname in resolver_resolve 11550/head
kevinshen [Thu, 7 Jul 2022 04:10:03 +0000 (12:10 +0800)]
lib: check hostname in resolver_resolve

resolver_resolve should check hostname is null or not.

if ares_gethostbyname() get null hostname string, the hostname string will access a null pointer and crash.

Signed-off-by: kevinshen <kevinshen@inspur.com>
(cherry picked from commit 30220d1e35a92bbf3e6694d81b308630c7db27c3)

2 years agoMerge pull request #11531 from FRRouting/mergify/bp/dev/8.3/pr-11508
Donatas Abraitis [Tue, 5 Jul 2022 16:52:08 +0000 (19:52 +0300)]
Merge pull request #11531 from FRRouting/mergify/bp/dev/8.3/pr-11508

isisd: fix infinite loop when parsing LSPs (backport #11508)

2 years agoisisd: fix infinite loop when parsing LSPs 11531/head
Louis Scalbert [Fri, 27 May 2022 08:42:53 +0000 (10:42 +0200)]
isisd: fix infinite loop when parsing LSPs

Fixing the crash:

> #0  0x0000560aa80f8e30 in lspdb_const_find (h=<error reading variable: Cannot access memory at address 0x7fff5e95efe8>, item=<error reading variable: Cannot access memory at address 0x7fff5e95efe0>) at ./isisd/isis_lsp.h:64
> #1  0x0000560aa80f8e9d in lspdb_find (h=0x560aaa1ed3b8, item=0x7fff5e95f050) at ./isisd/isis_lsp.h:64
> #2  0x0000560aa80f92f9 in lsp_search (head=0x560aaa1ed3b8, id=0x7fff5e95f200 "") at isisd/isis_lsp.c:100
> #3  0x0000560aa8113d69 in spf_adj_list_parse_tlv (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, id=0x560aad331a78 "", desig_is_id=0x0, pseudo_metric=0, metric=3, oldmetric=false, subtlvs=0x0) at isisd/isis_spf.c:1330
> #4  0x0000560aa811419d in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1429
> #5  0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #6  0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> (...)
> #65507 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65508 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65509 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1ff8e0, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65510 0x0000560aa81141fe in spf_adj_list_parse_lsp (spftree=0x560aaa1f09d0, adj_list=0x560aaa214480, lsp=0x560aaa1f4e50, pseudo_nodeid=0x0, pseudo_metric=0) at isisd/isis_spf.c:1442
> #65511 0x0000560aa8114313 in isis_spf_build_adj_list (spftree=0x560aaa1f09d0, lsp=0x560aaa1f4e50) at isisd/isis_spf.c:1455
> #65512 0x0000560aa8114f09 in isis_run_spf (spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1775
> #65513 0x0000560aa8115057 in isis_run_spf_with_protection (area=0x560aaa1ed3b0, spftree=0x560aaa1f09d0) at isisd/isis_spf.c:1801
> #65514 0x0000560aa8115311 in isis_run_spf_cb (thread=0x7fff5f15e5a0) at isisd/isis_spf.c:1859
> #65515 0x00007f90bac66dcc in thread_call (thread=0x7fff5f15e5a0) at lib/thread.c:2002
> #65516 0x00007f90bac013ee in frr_run (master=0x560aa9f5cb40) at lib/libfrr.c:1196
> #65517 0x0000560aa80e7da2 in main (argc=2, argv=0x7fff5f15e7b8, envp=0x7fff5f15e7d0) at isisd/isis_main.c:273

The fix is similar to the crash fix included in d9884a758c
("isisd: Prepare IS-IS for Link State support"). The fix was:

> diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
> index 94353a5bc8..92d329f035 100644
> --- a/isisd/isis_lsp.c
> +++ b/isisd/isis_lsp.c
> @@ -2166,7 +2178,7 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
>   if (lsp->hdr.seqno == 0 || lsp->hdr.rem_lifetime == 0)
>   return LSP_ITER_CONTINUE;
>
> - /* Parse main LSP. */
> + /* Parse LSP */
>   if (lsp->tlvs) {
>   if (!fabricd && !pseudo_lsp && family == AF_INET
>       && mtid == ISIS_MT_IPV4_UNICAST) {
> @@ -2236,13 +2248,17 @@ int isis_lsp_iterate_ip_reach(struct isis_lsp *lsp, int family, uint16_t mtid,
>   }
>   }
>
> - /* Parse LSP fragments. */
> - for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
> - if (!frag->tlvs)
> - continue;
> + /* Parse LSP fragments if it is not a fragment itself */
> + if (!LSP_FRAGMENT(lsp->hdr.lsp_id))
> + for (ALL_LIST_ELEMENTS_RO(lsp->lspu.frags, node, frag)) {
> + if (!frag->tlvs)
> + continue;
>
> - isis_lsp_iterate_ip_reach(frag, family, mtid, cb, arg);
> - }
> + if (isis_lsp_iterate_ip_reach(frag, family, mtid, cb,
> +       arg)
> +     == LSP_ITER_STOP)
> + return LSP_ITER_STOP;
> + }
>
>   return LSP_ITER_CONTINUE;
>  }

Fixes: 7b36d36e0e ("isisd: make the SPF code more modular")
Fixes: 5e56a50559 ("isisd: fix infinite loop when parsing LSPs")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit 8c8a5a02fa66523a96142083575e1eb7b0033667)

2 years agoRevert "isisd: fix infinite loop when parsing LSPs"
Louis Scalbert [Fri, 27 May 2022 08:37:08 +0000 (10:37 +0200)]
Revert "isisd: fix infinite loop when parsing LSPs"

This reverts commit 5e56a50559fd4a85f1912464e6e13d13969aa238.

(cherry picked from commit cab7be7d5b1dfe6badb35160dd84bc9a10d33aa2)

2 years agoMerge pull request #11518 from FRRouting/mergify/bp/dev/8.3/pr-11516
Donatas Abraitis [Fri, 1 Jul 2022 20:44:51 +0000 (23:44 +0300)]
Merge pull request #11518 from FRRouting/mergify/bp/dev/8.3/pr-11516

zebra: handle FreeBSD routing socket ENOBUFS (backport #11516)

2 years agozebra: handle FreeBSD routing socket ENOBUFS 11518/head
Rafael Zalamena [Fri, 1 Jul 2022 13:00:25 +0000 (10:00 -0300)]
zebra: handle FreeBSD routing socket ENOBUFS

This is a slightly modified version of Hiroki Sato's version:
https://github.com/hrs-allbsd/frr/commit/9ca79c941fd84322199994a2aed267b23d39c86a

Handle the `ENOBUFS` on a OS basis since it could have been implemented
differently (OpenBSD for an example uses `RTM_DESYNC`).

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
(cherry picked from commit 26e95efa4d49976951190fc416c8d91e8e735b87)

2 years agoMerge pull request #11510 from FRRouting/mergify/bp/dev/8.3/pr-11488
Donatas Abraitis [Fri, 1 Jul 2022 10:06:50 +0000 (13:06 +0300)]
Merge pull request #11510 from FRRouting/mergify/bp/dev/8.3/pr-11488

lib: Allow downgrade of all caps when none are specified (backport #11488)

2 years agolib: Allow downgrade of all caps when none are specified 11510/head
Donald Sharp [Tue, 28 Jun 2022 14:26:52 +0000 (10:26 -0400)]
lib: Allow downgrade of all caps when none are specified

Staticd when run tells privs.c that it does not need any
priviledges.  The lib/privs.c code was not downgrading
any and all permissions it may have been given at startup.

Since we don't need any let's actually tell the system that
FRR does not need the capabilities anymore in the case
where a daemon does not ask for any cap's.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 88be4045c9e09d9b36952ed594e4bbc19633deba)

2 years agoMerge pull request #11496 from FRRouting/mergify/bp/dev/8.3/pr-11468
Donald Sharp [Thu, 30 Jun 2022 11:19:07 +0000 (07:19 -0400)]
Merge pull request #11496 from FRRouting/mergify/bp/dev/8.3/pr-11468

 pimd: Fixing invalid memory access (backport #11468)

2 years agoMerge pull request #11498 from FRRouting/mergify/bp/dev/8.3/pr-11429
Donald Sharp [Thu, 30 Jun 2022 11:18:39 +0000 (07:18 -0400)]
Merge pull request #11498 from FRRouting/mergify/bp/dev/8.3/pr-11429

zebra: Fix rtadv startup when config read in is before interface up (backport #11429)

2 years agoMerge pull request #11497 from FRRouting/mergify/bp/dev/8.3/pr-11434
Donald Sharp [Thu, 30 Jun 2022 11:15:19 +0000 (07:15 -0400)]
Merge pull request #11497 from FRRouting/mergify/bp/dev/8.3/pr-11434

Crash fix and test fix and some cleanup (backport #11434)

2 years agoMerge pull request #11500 from FRRouting/mergify/bp/dev/8.3/pr-11493
Donald Sharp [Thu, 30 Jun 2022 11:15:04 +0000 (07:15 -0400)]
Merge pull request #11500 from FRRouting/mergify/bp/dev/8.3/pr-11493

pimd: Register stop message sent with mask 32 (backport #11493)

2 years agoMerge pull request #11495 from FRRouting/mergify/bp/dev/8.3/pr-11481
Donald Sharp [Thu, 30 Jun 2022 11:14:52 +0000 (07:14 -0400)]
Merge pull request #11495 from FRRouting/mergify/bp/dev/8.3/pr-11481

pimd: Querier to non-querier transition to be ignored (ANVL Conformance fix) (backport #11481)

2 years agopimd: Register stop message sent with mask 32 11500/head
Sarita Patra [Wed, 29 Jun 2022 13:34:19 +0000 (06:34 -0700)]
pimd: Register stop message sent with mask 32

As per RFC 4601 section 4.9.4, For Register-Stops,
the Mask Len field contains full address length * 8
(e.g. 32 for IPv4 native encoding) (e.g. 128 for IPv6),
if the message is sent for a single group

The issue is seen after 10356, so fixed now.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 8e51ca271eebd9bec96dbe753e261e4953ae4b33)

2 years agozebra: Fix rtadv startup when config read in is before interface up 11498/head
Donald Sharp [Fri, 17 Jun 2022 15:23:31 +0000 (11:23 -0400)]
zebra: Fix rtadv startup when config read in is before interface up

When a interface is configured with this:
int eva
  ipv6 nd ra-interval 5
  no ipv6 nd suppress-ra
!

And then subsuquently the interface is created and brought up, FRR
would both error on joining the RA multicast address and never
properly work in this state.

Delay the startup of the join and start of the Router Advertisements
until after the ifindex has actually been found.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7937058b94bfa3b26a8fb8222a956a25cdbe1e00)

2 years agoisisd: Fix crash with xfrm interface type 11497/head
Donald Sharp [Sat, 18 Jun 2022 18:37:14 +0000 (14:37 -0400)]
isisd: Fix crash with xfrm interface type

When creating a xfrm interface FRR is crashing when configured
with isis.  This is because the weird pattern of not allocating
list's until needed and then allowing the crash when we have
a usage pattern that was not expected.  Just always allocate
the different lists that a circuit needs.

(gdb) bt
(gdb)

Fixes #11432
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 91a5bbc4de1bfe03618b5c4d11cf32f45e20e8e7)

2 years agotests: Increase time for zebra_seg6local to look for sharp routes
Donald Sharp [Fri, 17 Jun 2022 19:40:36 +0000 (15:40 -0400)]
tests: Increase time for zebra_seg6local to look for sharp routes

I have a test failure:
            r1.vtysh_cmd(
                "sharp install seg6local-routes {} nexthop-seg6local dum0 {} 1".format(
                    dest, context
                )
            )
            test_func = partial(
                check,
                r1,
                dest,
                manifest["out"],
            )
            success, result = topotest.run_and_expect(test_func, None, count=5, wait=1)
>           assert result is None, "Failed"
E           AssertionError: Failed
E           assert Generated JSON diff error report:
E
E             > $: d2 has the following element at index 0 which is not present in d1:
E
E              {
E                  "prefix": "1::1/128",
E                  "protocol": "sharp",
E                  "selected": true,...
E

The test output for 1::1/128:
{
  "1::1/128":[
    {
      "prefix":"1::1/128",
      "prefixLen":128,
      "protocol":"sharp",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      "destSelected":true,
      "distance":150,
      "metric":0,
      "queued":true,
      "table":254,
      "internalStatus":8,

Notice that it is still queued after 5 seconds.  Under extremely heavy system load
this is not long enough for convergence.  Also the zebra.log shows thread starvation
as well as long running tasks
2022/06/17 15:30:02 ZEBRA: [PHJDC-499N2][EC 100663314] STARVATION: task dplane_incoming_request (55b3ce0fea8b) ran for 6369ms (cpu time 0ms)
2022/06/17 15:30:02 ZEBRA: [T83RR-8SM5G] zebra 8.4-dev starting: vty@2601
2022/06/17 15:30:02 ZEBRA: [YZRX4-ZXG0C][EC 100663315] Thread Starvation: {(thread *)0x55b3ce6c15b0 arg=0x0 timer  r=-6.375     rib_sweep_route() &zrouter.sweeper from zebra/main.c:447} was scheduled to pop greater than 4s ago

Increasing the time to 25 seconds to give it a chance.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit de448ea2e88b01b99c0a2966dbb028f0fb4cfe59)

2 years agotests: Fix regex complaints by python3
Donald Sharp [Fri, 17 Jun 2022 19:40:14 +0000 (15:40 -0400)]
tests: Fix regex complaints by python3

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 37076cae05323716c5a89905db30b4bda0e85840)

2 years agopimd: fix invalid memory access join_timer_stop 11496/head
Sarita Patra [Fri, 24 Jun 2022 10:04:37 +0000 (03:04 -0700)]
pimd: fix invalid memory access join_timer_stop

Issue:
==16837== Invalid read of size 8
==16837==    at 0x17971C: pim_neighbor_find (pim_neighbor.c:431)
==16837==    by 0x186439: join_timer_stop (pim_upstream.c:348)
==16837==    by 0x186794: pim_upstream_del (pim_upstream.c:231)
==16837==    by 0x189A66: pim_upstream_terminate (pim_upstream.c:1951)
==16837==    by 0x17111B: pim_instance_terminate (pim_instance.c:54)
==16837==    by 0x17111B: pim_vrf_delete (pim_instance.c:172)
==16837==    by 0x4F1D6C8: vrf_delete (vrf.c:264)
==16837==    by 0x19006F: pim_terminate (pimd.c:160)
==16837==    by 0x1B2E4D: pim_sigterm (pim_signals.c:51)
==16837==    by 0x4F08FA2: frr_sigevent_process (sigevent.c:130)
==16837==    by 0x4F1A2CC: thread_fetch (thread.c:1771)
==16837==    by 0x4ED4F92: frr_run (libfrr.c:1197)
==16837==    by 0x15D81A: main (pim_main.c:176)

Root Cause:
In the pim_terminate flow, the interface is deleted
before the pim_interface clean up. Because of this,
the pim_interface is having garbage value.

Fix:
Release the pim interface memory and then delete the
interface.

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit bc26d1bb61b56fe334f4e217e371999a5bae25b5)

2 years agopimd: Querier to non-querier transition to be ignored 11495/head
Mobashshera Rasool [Mon, 27 Jun 2022 12:25:29 +0000 (05:25 -0700)]
pimd: Querier to non-querier transition to be ignored

Fixing IGMPv2 ANVL Conformance issue 3.10

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.

Currently the code is handling this scenario only when leave is receive
for a group and the query is received for the same group.
But we need to handle it irrespective of group since the querier
election is based on interface and not group.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit 8d9e46a72776f4928de0e8f78edad389c1ff7948)

2 years agoMerge pull request #11473 from FRRouting/mergify/bp/dev/8.3/pr-11430
Donald Sharp [Fri, 24 Jun 2022 16:37:11 +0000 (12:37 -0400)]
Merge pull request #11473 from FRRouting/mergify/bp/dev/8.3/pr-11430

ospf6: permit route delete without nexthops (backport #11430)

2 years agoospf6: permit route delete without nexthops 11473/head
Mark Stapp [Fri, 17 Jun 2022 15:47:55 +0000 (11:47 -0400)]
ospf6: permit route delete without nexthops

It's possible for ospf6 to decide to delete a route after it's
removed all of the route's nexthops. It's ok to delete a prefix
alone - be a little more forgiving when preparing a route delete.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit 0f9e2c918b864e8ff0847ab25e2b1ecdf070d1c2)

2 years agoMerge pull request #11435 from FRRouting/mergify/bp/dev/8.3/pr-11425 frr-8.3-rc
Donatas Abraitis [Mon, 20 Jun 2022 07:47:33 +0000 (10:47 +0300)]
Merge pull request #11435 from FRRouting/mergify/bp/dev/8.3/pr-11425

lib: cleanup red-herring memleaks in parent of daemonizing fork (backport #11425)

2 years agolib: cleanup red-herring memleaks in parent of daemonizing fork 11435/head
Christian Hopps [Fri, 17 Jun 2022 06:04:51 +0000 (02:04 -0400)]
lib: cleanup red-herring memleaks in parent of daemonizing fork

- The parent of the daemonizing fork reports memleaks for the early
northbound allocations (libyang). If these were real memleaks these
would show up in the child as well; however, ignoring all memleaks in
the parent of the fork is too hard a sale. Instead, spend some CPU
cycles cleaning up the allocations in the parent after the fork and
immeidatley prior to exiting the parent after the daemonizing fork.

Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit 1213e46bfd4aaf2897787b4dc03879d4d1b81fa6)

2 years agoMerge pull request #11413 from FRRouting/mergify/bp/dev/8.3/pr-11403
Jafar Al-Gharaibeh [Wed, 15 Jun 2022 17:30:48 +0000 (12:30 -0500)]
Merge pull request #11413 from FRRouting/mergify/bp/dev/8.3/pr-11403

replace the import/export keywords for in/out (backport #11403)

2 years agodoc: replace the import/export keywords for in/out 11413/head
Maximiliano Estudies [Tue, 14 Jun 2022 13:16:43 +0000 (15:16 +0200)]
doc: replace the import/export keywords for in/out

Signed-off-by: Maximiliano Estudies <maxiestudies@gmail.com>
(cherry picked from commit e007d49e1e2553497a5ff90670f984dad3cbf5e9)

2 years agoMerge pull request #11402 from FRRouting/mergify/bp/dev/8.3/pr-11343
Russ White [Tue, 14 Jun 2022 15:26:51 +0000 (11:26 -0400)]
Merge pull request #11402 from FRRouting/mergify/bp/dev/8.3/pr-11343

bgpd: Initialize attr->local_pref to the configured default value (backport #11343)

2 years agoMerge pull request #11396 from FRRouting/mergify/bp/dev/8.3/pr-11358
Russ White [Tue, 14 Jun 2022 11:38:22 +0000 (07:38 -0400)]
Merge pull request #11396 from FRRouting/mergify/bp/dev/8.3/pr-11358

bgpd: Fix VRF leaking when import/export RT list changed with route-maps (backport #11358)

2 years agobgpd: Initialize attr->local_pref to the configured default value 11402/head
Donatas Abraitis [Mon, 6 Jun 2022 06:49:37 +0000 (09:49 +0300)]
bgpd: Initialize attr->local_pref to the configured default value

When we use network/redistribute local_preference is configured inproperly
when using route-maps something like:

```
network 100.100.100.100/32 route-map rm1
network 100.100.100.200/32 route-map rm2

route-map rm1 permit 10
 set local-preference +10
route-map rm2 permit 10
 set local-preference -10
```

Before:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
10
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
0
```

After:
```
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32 json' | jq '.paths[].locPrf'
110
root@spine1-debian-11:~# vtysh -c 'show bgp ipv4 unicast 100.100.100.200/32 json' | jq '.paths[].locPrf'
90
```

Set local-preference as the default value configured per BGP instance, but
do not set LOCAL_PREF flag by default.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 0f05ea43b0c18c890ef0faf81de1d4ad74893d86)

2 years agoMerge pull request #11398 from FRRouting/mergify/bp/dev/8.3/pr-11333
Russ White [Tue, 14 Jun 2022 01:27:11 +0000 (21:27 -0400)]
Merge pull request #11398 from FRRouting/mergify/bp/dev/8.3/pr-11333

bgpd: Fix memory leak when setting [l]community at egress (backport #11333)

2 years agobgpd: Fix memory leak when setting [l]community at egress 11398/head
Donatas Abraitis [Thu, 2 Jun 2022 10:30:42 +0000 (13:30 +0300)]
bgpd: Fix memory leak when setting [l]community at egress

```
==2209758== 7,791,480 (399,840 direct, 7,391,640 indirect) bytes in 9,996 blocks are definitely lost in loss record 102 of 103
==2209758==    at 0x4C33B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==2209758==    by 0x4EE264F: qcalloc (memory.c:116)
==2209758==    by 0x22E62A: lcommunity_new (bgp_lcommunity.c:42)
==2209758==    by 0x22E62A: lcommunity_dup (bgp_lcommunity.c:155)
==2209758==    by 0x26F28F: route_set_lcommunity (bgp_routemap.c:2382)
==2209758==    by 0x4EFF7EF: route_map_apply_ext (routemap.c:2663)
==2209758==    by 0x250B3D: subgroup_announce_check (bgp_route.c:2202)
==2209758==    by 0x27A195: subgroup_announce_table (bgp_updgrp_adv.c:690)
==2209758==    by 0x27A509: subgroup_coalesce_timer (bgp_updgrp_adv.c:332)
==2209758==    by 0x4F1C3FC: thread_call (thread.c:2002)
==2209758==    by 0x4ED6D67: frr_run (libfrr.c:1196)
==2209758==    by 0x1E921B: main (bgp_main.c:519)
```

To reproduce it's enough to have something like applied at egress:

```
route-map test permit 10
 on-match goto 15
 set large-community 20717:0:0 20717:1:1820 20717:1:3303 20717:1:4788 20717:1:5416 20717:1:5713 20717:1:6774 20717:1:8309 20717:1:8529 20717:1:8697 20717:1:8966 20717:1:9038 20717:1:9119 20717:1:9304 20717:1:9498 20717:1:12779 20717:1:12883 20717:1:13113 20717:1:14340 20717:1:14907 20717:1:15802 20717:1:16347 20717:1:16637 20717:1:18403 20717:1:20717 20717:1:20928 20717:1:21245 20717:1:25818 20717:1:28917 20717:1:30844 20717:1:30990 20717:1:31133 20717:1:35297 20717:1:35320 20717:1:35432 20717:1:35819 20717:1:35838 20717:1:36994 20717:1:37100 20717:1:37558 20717:1:37662 20717:1:39180 20717:1:39405 20717:1:41095 20717:1:43996 20717:1:45489 20717:1:45903 20717:1:47794 20717:1:51185 20717:1:51254 20717:1:58715 20717:1:59605 20717:1:60427 20717:1:62955 20717:1:63008 20717:1:63927 20717:1:64049 20717:1:132602 20717:1:198435 20717:1:205988 20717:1:208278 20717:1:327700
exit
!
route-map test deny 15
exit
!
```

On the other side doing:
```
spine1-debian-11# sharp install routes 100.100.100.1 nexthop 192.168.10.65 30
spine1-debian-11# sharp remove routes 100.100.100.1 30
spine1-debian-11# sharp install routes 100.100.100.1 nexthop 192.168.10.65 30
```

Before:

```
Large Community               :       66     40        2816       66      2816
Large Community value         :       66 variable     29728       66     29728
Large Community               :       96     40        4096       96      4096
Large Community value         :       96 variable     52048       96     52048
```

After:
```
Large Community               :       28     40        1152       29      1192
Large Community value         :       28 variable      1456       29      2200
Large Community               :       28     40        1152       29      1192
Large Community value         :       28 variable      1456       29      2200
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit a49e87d2d4813397cf0888f11c2600102d6202b0)

2 years agotests: Check if old paths are flushed when import/export RT list was changed 11396/head
Donatas Abraitis [Fri, 10 Jun 2022 11:49:36 +0000 (14:49 +0300)]
tests: Check if old paths are flushed when import/export RT list was changed

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit c170a6084fb9799f3edc9d6945ec7aa46e9a160c)

2 years agobgpd: Print source VRF name when leaking to another VRF
Donatas Abraitis [Tue, 7 Jun 2022 19:24:40 +0000 (22:24 +0300)]
bgpd: Print source VRF name when leaking to another VRF

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ba9dce1c87f365c749ee75d4c6596f52fd752fb5)

2 years agobgpd: Withdraw implicitly old paths from VRFs when import/export list changes
Donatas Abraitis [Tue, 7 Jun 2022 19:12:07 +0000 (22:12 +0300)]
bgpd: Withdraw implicitly old paths from VRFs when import/export list changes

If we overwrite import/export RT list via route-maps or even flush by using
`set extcommunity none`, then we must withdraw old paths from VRFs to avoid
stale paths.

For example using:

```
router bgp 65500 vrf vrf1
 bgp router-id 10.180.1.1
 !
 address-family ipv4 unicast
  network 192.168.100.100/32 route-map rm
  rd vpn export 65500:10001
  rt vpn import 65500:10000 65500:10990
  rt vpn export 65500:10000
  export vpn
  import vpn
 exit-address-family
exit
!
router bgp 65500 vrf vrf2
 bgp router-id 10.180.1.1
 !
 address-family ipv4 unicast
  rd vpn export 65500:11001
  rt vpn import 65500:11000 65500:11990
  rt vpn export 65500:11000
  export vpn
  import vpn
 exit-address-family
exit
!
route-map rm permit 10
 set extcommunity rt 65500:10100 65500:12990 65500:13990 65500:11990
exit
```

If we strip extcommunities using:

```
route-map rm permit 10
 set extcommunity none
exit
```

or

```
route-map rm permit 10
 set extcommunity rt 65500:10100 65500:12990 65500:13990
```

Routes that are imported with 65500:11990 (192.168.100.100/32 from vrf1)
becomes stale.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 3840a8193ea9dcc3a8b61cd4a5d890879878986e)

2 years agoMerge pull request #11393 from FRRouting/mergify/bp/dev/8.3/pr-11378
Donald Sharp [Sun, 12 Jun 2022 12:00:53 +0000 (08:00 -0400)]
Merge pull request #11393 from FRRouting/mergify/bp/dev/8.3/pr-11378

lib: sysrepo compilation issues (backport #11378)

2 years agolib: Require at least 2.1.42 version of sysrepo when compiling 11393/head
Donatas Abraitis [Thu, 9 Jun 2022 14:38:37 +0000 (17:38 +0300)]
lib: Require at least 2.1.42 version of sysrepo when compiling

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 981b25429799df19c061691d8b1380700d5533a6)

2 years agolib: Update sysrepo code with the latest API changes
Donatas Abraitis [Thu, 9 Jun 2022 14:33:22 +0000 (17:33 +0300)]
lib: Update sysrepo code with the latest API changes

* sr_event_notif_send -> sr_notif_send
* sr_process_events -> sr_subscription_process_events
* sr_oper_get_items_subscribe -> sr_oper_get_subscribe
* Removed SR_SUBSCR_CTX_REUSE flag from the code at all

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 1dd5ce9b9317cce35fc6702f63d48ec7213af1fe)

2 years agoMerge pull request #11386 from FRRouting/mergify/bp/dev/8.3/pr-11367
Donatas Abraitis [Fri, 10 Jun 2022 09:23:50 +0000 (12:23 +0300)]
Merge pull request #11386 from FRRouting/mergify/bp/dev/8.3/pr-11367

Babel updates (backport #11367)

2 years agobabeld: Ignore sub-tlv's with mandatory bit set 11386/head
Donald Sharp [Wed, 8 Jun 2022 13:01:31 +0000 (09:01 -0400)]
babeld: Ignore sub-tlv's with mandatory bit set

RFC 8966 4.4

   If the mandatory bit is set, then the
   whole enclosing TLV MUST be silently ignored (except for updating the
   parser state by a Router-Id, Next Hop, or Update TLV, as described in
   the next section).

Fixes: #11349
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit a76cf7e49e62b60d5aedd1e6d6f562cb90ed051b)

2 years agobabeld: Update to ignore unicast hellos
Donald Sharp [Wed, 8 Jun 2022 12:41:05 +0000 (08:41 -0400)]
babeld: Update to ignore unicast hellos

RFC 8966 requires a bit of work to make FRR forward compabitble with
it for the moment.

tl;dr -> Flags of hellos should be 0 except the main bit and
The Unicast Hello bit if set should cause the packet to be ignored.
Additionally FRR needs to ignore Hello packets with the interval field
set to 0.

Fixes: #11349
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 54a3e60b3ebd3621c4dd90b0b49e8e36e4e100d8)

2 years agoMerge pull request #11381 from FRRouting/mergify/bp/dev/8.3/pr-11372
Donatas Abraitis [Fri, 10 Jun 2022 05:40:45 +0000 (08:40 +0300)]
Merge pull request #11381 from FRRouting/mergify/bp/dev/8.3/pr-11372

pimd: Fix pim_channel_oil_empty tests (backport #11372)

2 years agoMerge pull request #11380 from FRRouting/mergify/bp/dev/8.3/pr-11377
Jafar Al-Gharaibeh [Thu, 9 Jun 2022 21:56:50 +0000 (16:56 -0500)]
Merge pull request #11380 from FRRouting/mergify/bp/dev/8.3/pr-11377

pimd: Show interface traffic even if interface is currently `down` (backport #11377)

2 years agopimd: Fixup oil_if_has and oil_if_set to be consistent 11381/head
Donald Sharp [Thu, 9 Jun 2022 11:06:30 +0000 (07:06 -0400)]
pimd: Fixup oil_if_has and oil_if_set to be consistent

the v4 and v6 versions were different.  Make them the same.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit aa0bb312b1730de6c5e5cc102bca427ef5803712)

2 years agotests: Clarify what test_pim_dr_nondr_with_static_routes_topo1.py is doing
Donald Sharp [Wed, 8 Jun 2022 20:56:22 +0000 (16:56 -0400)]
tests: Clarify what test_pim_dr_nondr_with_static_routes_topo1.py is doing

There are a couple steps listing what is being done that are both inprecise
and missleading.  Fix to actually say what is going on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit b2e37a56f60455c0bf935f26309ae596ef5ee34f)

2 years agopimd: Fix pim_channel_oil_empty tests
Donald Sharp [Wed, 8 Jun 2022 20:51:48 +0000 (16:51 -0400)]
pimd: Fix pim_channel_oil_empty tests

The pim_channel_oil_empty() function was setting
the pimreg if it ever existed for NULL comparison
but of course the pimreg device is never pulled back
out again when it was needed to be when the pimreg
is not present.

Commit: a5fa982256b23d53d5b833f75224fb7f96054b9b
broke this.

Fixes: #11368
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 30b82c7af79fc167c39c1063c4e269c29e108fe4)

2 years agopimd: Show interface traffic even if interface is currently `down` 11380/head
Donald Sharp [Thu, 9 Jun 2022 14:29:04 +0000 (10:29 -0400)]
pimd: Show interface traffic even if interface is currently `down`

the `show ip pim interface [x] traffic` command was deciding
to skip display of interfaces if they happened to be down at
that moment.  This of course does not make a bunch of sense
to limit the output for a interface that may have sent data
in the past.

This fixes this test crash:
rnode = <lib.topogen.TopoRouter object at 0x7fc755be3880>, dut = 'c1', input_dict = {'c1': {'c1-l1-eth2': ['helloTx', 'helloRx']}}, output_dict = {'c1': {}}

    def show_pim_intf_traffic(rnode, dut, input_dict, output_dict):
        show_pim_intf_traffic_json = run_frr_cmd(
            rnode, "show ip pim interface traffic json", isjson=True
        )

        output_dict[dut] = {}
        for intf, data in input_dict[dut].items():
>           interface_json = show_pim_intf_traffic_json[intf]
E           KeyError: 'c1-l1-eth2'

/home/sharpd/frr8/tests/topotests/lib/pim.py:1496: KeyError

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit a64543e3e8f0210e12bf9749e4302dc216f93b61)

2 years agoMerge pull request #11373 from FRRouting/mergify/bp/dev/8.3/pr-11369
Donatas Abraitis [Thu, 9 Jun 2022 10:05:47 +0000 (13:05 +0300)]
Merge pull request #11373 from FRRouting/mergify/bp/dev/8.3/pr-11369

pimd: pim_addr_cmp returns 0 for same not -1 or 1 (backport #11369)

2 years agopimd: pim_addr_cmp returns 0 for same not -1 or 1 11373/head
Donald Sharp [Wed, 8 Jun 2022 15:33:32 +0000 (11:33 -0400)]
pimd: pim_addr_cmp returns 0 for same not -1 or 1

The test for setting pimDesignatedRouterLocal was comparing
the result of pim_addr_cmp to non zero to say that the
pim_dr_addr and primary_address are the same.  This is
not correct in that pim_addr_cmp returns 0 for being the
same, so the correct test is !pim_addr_cmp

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit e0220703d1084b97164fe4d8260453f3eb8df38b)

2 years agoMerge pull request #11364 from FRRouting/mergify/bp/dev/8.3/pr-11356
Jafar Al-Gharaibeh [Thu, 9 Jun 2022 04:54:38 +0000 (23:54 -0500)]
Merge pull request #11364 from FRRouting/mergify/bp/dev/8.3/pr-11356

pimd: Handle receive of (*,G) register stop with src addr as 0 (backport #11356)

2 years agopimd: Handle receive of (*,G) register stop with src addr as 0 11364/head
Mobashshera Rasool [Tue, 7 Jun 2022 12:41:37 +0000 (05:41 -0700)]
pimd: Handle receive of (*,G) register stop with src addr as 0

PIM conformance test case 11.12 sends a register stop msg with
source address as 0. This should trigger a register stop for
all the upstreams. It is not happening as such because we are not
considering 0.0.0.0 source address for starg_handling.

Fixed it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
(cherry picked from commit e502ecad11ec444a83bf7ad87e0c446d986bb8c7)

2 years agoMerge pull request #11312 from opensourcerouting/feature/draft-ietf-idr-bfd-subcode base_8.3
Pushpasis Sarkar [Tue, 7 Jun 2022 15:57:12 +0000 (21:27 +0530)]
Merge pull request #11312 from opensourcerouting/feature/draft-ietf-idr-bfd-subcode

bgpd: Add Notification CEASE BFD Down message

2 years agoMerge pull request #11334 from ton31337/fix/deprecation_warning
Olivier Dugeon [Tue, 7 Jun 2022 15:38:52 +0000 (17:38 +0200)]
Merge pull request #11334 from ton31337/fix/deprecation_warning

ospfd: Remove local-block deprecated command

2 years agoMerge pull request #11158 from cyberstormdotmu/master
Pushpasis Sarkar [Tue, 7 Jun 2022 15:35:03 +0000 (21:05 +0530)]
Merge pull request #11158 from cyberstormdotmu/master

lib/md5,lib/sha256: Use explicit_bzero to clean up sensitive data.

2 years agoMerge pull request #11318 from pguibert6WIND/isis_mt_std
Russ White [Tue, 7 Jun 2022 15:30:05 +0000 (11:30 -0400)]
Merge pull request #11318 from pguibert6WIND/isis_mt_std

isisd: add ISIS_MT_STANDARD define

2 years agoMerge pull request #11289 from LabNConsulting/chopps/ospfapi-update
Donald Sharp [Tue, 7 Jun 2022 15:00:56 +0000 (11:00 -0400)]
Merge pull request #11289 from LabNConsulting/chopps/ospfapi-update

ospfapi improvements and fixes

2 years agoospfd: Remove local-block deprecated command 11334/head
Donatas Abraitis [Thu, 2 Jun 2022 10:45:57 +0000 (13:45 +0300)]
ospfd: Remove local-block deprecated command

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotests: add opaque api test 11289/head
Christian Hopps [Tue, 10 May 2022 16:13:04 +0000 (12:13 -0400)]
tests: add opaque api test

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfclient: add ospfclient api python class
Christian Hopps [Fri, 24 Dec 2021 07:04:57 +0000 (02:04 -0500)]
ospfclient: add ospfclient api python class

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: api: always ready to receive opaque from client
Christian Hopps [Tue, 25 Jan 2022 09:53:53 +0000 (04:53 -0500)]
ospfd: api: always ready to receive opaque from client

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: api: add new ISM and NSM sync requests
Christian Hopps [Wed, 19 Jan 2022 11:42:03 +0000 (06:42 -0500)]
ospfd: api: add new ISM and NSM sync requests

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: api: remove unused api code/message creation
Christian Hopps [Fri, 14 Jan 2022 15:39:07 +0000 (10:39 -0500)]
ospfd: api: remove unused api code/message creation

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: api: fix recovery of LSA after restart of api client
Christian Hopps [Sat, 8 Jan 2022 21:57:10 +0000 (16:57 -0500)]
ospfd: api: fix recovery of LSA after restart of api client

Prior to this fix, restarting the client just failed b/c the code tried to
"refresh" the existing LSA being added, except that code checked for meta-data
to exist, which was deleted when the client disconnected previously (or had
never connected and the LSA state was picked up from the network).

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: cli: add "show ip ospf reachable-routers" CLI
Christian Hopps [Mon, 17 Jan 2022 12:55:14 +0000 (07:55 -0500)]
ospfd: cli: add "show ip ospf reachable-routers" CLI

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: api: add reachable router notifications
Christian Hopps [Wed, 1 Jun 2022 19:25:35 +0000 (15:25 -0400)]
ospfd: api: add reachable router notifications

Reachable router information is used by OSPF opaque clients in order
to determine if the router advertising the opaque LSA data is
reachable (i.e., 2-way conectivity check).

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoospfd: add all_rtrs route table when opaque enabled
Christian Hopps [Sat, 15 Jan 2022 11:13:43 +0000 (06:13 -0500)]
ospfd: add all_rtrs route table when opaque enabled

The reachable router table is used by OSPF opaque clients in order to
determine if the router advertising the opaque LSA data is
reachable (i.e., 2-way conectivity check).

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoisisd: replace ipv4-unicast with standard in config and oper contexts 11318/head
Philippe Guibert [Wed, 1 Jun 2022 13:37:49 +0000 (15:37 +0200)]
isisd: replace ipv4-unicast with standard in config and oper contexts

Only the multi-topology command can use 'ipv4-unicast' keyword to
configure standard topology.
The remaining code: dump from show commands, and yang definition,
uses 'standard' keyword instead.

The test have not been modified. The change would consists in
modifying test_fuzz_isis_tlv_tests.h.gz:
- replacing ipv4-unicast occurences with standard
\x69\x70\x76\x34\x2d\x75\x6e\x69\x63\x61\x73\x74
with
\x73\x74\x61\x6e\x64\x61\x72\x64

- align the buffer length by removing 4 bytes per occurence
Instead, a specific isis_mtid2str_fake() routing has been
put in place in isis_tlvs.c file.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2 years agoMerge pull request #11175 from louis-6wind/ip-vrf-exec
Jafar Al-Gharaibeh [Thu, 2 Jun 2022 18:33:49 +0000 (13:33 -0500)]
Merge pull request #11175 from louis-6wind/ip-vrf-exec

topotests: fix "ip vrf exec"

2 years agoMerge pull request #11329 from opensourcerouting/ospf6-frag-rx
Donald Sharp [Thu, 2 Jun 2022 13:11:56 +0000 (09:11 -0400)]
Merge pull request #11329 from opensourcerouting/ospf6-frag-rx

ospf6d: fix rx/tx buffer sizes

2 years agobgpd: Add Notification CEASE BFD Down message 11312/head
Donatas Abraitis [Mon, 30 May 2022 14:40:15 +0000 (17:40 +0300)]
bgpd: Add Notification CEASE BFD Down message

Related: https://datatracker.ietf.org/doc/html/draft-ietf-idr-bfd-subcode

When BFD Down notification comes and BGP is configured to track on BFD events,
send BGP Cease/BFD Down notification to the peer.

If RFC 8538 is enabled (Notification support for Graceful-Restart), notification
should be encapsulated into Hard Reset message.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoospfd: cli: add client api debug option
Christian Hopps [Mon, 17 Jan 2022 12:54:12 +0000 (07:54 -0500)]
ospfd: cli: add client api debug option

Signed-off-by: Christian Hopps <chopps@labn.net>
2 years agoMerge pull request #11314 from chiragshah6/fdev2
Jafar Al-Gharaibeh [Wed, 1 Jun 2022 17:45:49 +0000 (12:45 -0500)]
Merge pull request #11314 from chiragshah6/fdev2

zebra: add error check condition to sock option

2 years agoospf6d: fix rx/tx buffer sizes 11329/head
David Lamparter [Wed, 1 Jun 2022 15:10:11 +0000 (17:10 +0200)]
ospf6d: fix rx/tx buffer sizes

OSPFv3 packets can be fragmented and up to 64k long, regardless of
interface MTU.  Trying to size these buffers to MTU is just plain wrong.
To not make this a super intrusive change during the 8.3 release freeze,
just code this into ospf6_iobuf_size().

Since the buffer is now always 64k, don't waste time zeroing the entire
thing in receive;  instead just zero kind of a "sled" of 128 bytes after
the buffer as a security precaution.

Fixes: #11298
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>