]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
11 months agoisisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN
zhou-run [Tue, 9 Apr 2024 13:04:39 +0000 (21:04 +0800)]
isisd: Fix memory leaks when the transition of neighbor state from non-UP to DOWN

When receiving a hello packet, if the neighbor state transitions directly from a non-ISIS_ADJ_UP state (such as ISIS_ADJ_INITIALIZING) to ISIS_ADJ_DOWN state, the neighbor entry cannot be deleted. If the neighbor is removed or the neighbor's System ID changes, it may result in memory leakage in the neighbor entry.

Test Scenario:
LAN link between Router A and Router B is established. Router A does not configure neighbor authentication, while Router B is configured with neighbor authentication. When the neighbor entry on Router B ages out, the neighbor state on Router A transitions to INIT. If Router B is then removed, the neighbor state on Router A transitions to DOWN and persists.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
fix frrbot styling issues found.

fix frrbot styling issues found.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
12 months agoisisd: The hold time of hello packets on a P2P link does not match the sending interval.
zhou-run [Tue, 9 Apr 2024 12:59:22 +0000 (20:59 +0800)]
isisd: The hold time of hello packets on a P2P link does not match the sending interval.

The hold time filled in the hello packets of a P2P link is calculated based on the level 1 configuration, while the hello timer is based on the level 2 configuration. If the hello interval times in level 1 and level 2 configurations are inconsistent, it may lead to neighbor establishment failure.

Signed-off-by: zhou-run <166502045+zhou-run@users.noreply.github.com>
12 months agoMerge pull request #15703 from louis-6wind/add-linkbw-diagram
Mark Stapp [Tue, 9 Apr 2024 12:34:11 +0000 (08:34 -0400)]
Merge pull request #15703 from louis-6wind/add-linkbw-diagram

tests: add ascii diagram to test_bgp_linkbw_ip

12 months agoMerge pull request #15645 from opensourcerouting/fix/show_ip_route_vrf_all_summary_json
Donald Sharp [Mon, 8 Apr 2024 15:12:40 +0000 (11:12 -0400)]
Merge pull request #15645 from opensourcerouting/fix/show_ip_route_vrf_all_summary_json

zebra: Fix JSON output for `show route summary json`

12 months agotests: add ascii diagram to test_bgp_linkbw_ip
Louis Scalbert [Tue, 26 Mar 2024 09:23:37 +0000 (10:23 +0100)]
tests: add ascii diagram to test_bgp_linkbw_ip

Add ASCII diagram to test_bgp_linkbw_ip

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoMerge pull request #15700 from anlancs/fix/doc-bgp-gr
Donatas Abraitis [Mon, 8 Apr 2024 13:35:23 +0000 (16:35 +0300)]
Merge pull request #15700 from anlancs/fix/doc-bgp-gr

doc: fix one bgp command

12 months agodoc: fix one bgp command
anlan_cs [Mon, 8 Apr 2024 09:24:40 +0000 (17:24 +0800)]
doc: fix one bgp command

Fixed one bgp comamnd based on code.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agoMerge pull request #15687 from anlancs/fix/doc-isisd-append-vrf
Donald Sharp [Fri, 5 Apr 2024 23:29:04 +0000 (19:29 -0400)]
Merge pull request #15687 from anlancs/fix/doc-isisd-append-vrf

doc: correct a few commands for isis

12 months agoMerge pull request #15675 from pguibert6WIND/srv6_bsid_to_seg6local_2str
Donatas Abraitis [Fri, 5 Apr 2024 17:49:27 +0000 (20:49 +0300)]
Merge pull request #15675 from pguibert6WIND/srv6_bsid_to_seg6local_2str

lib: add srv6 bsid to seg6local_context2str

12 months agoMerge pull request #15640 from opensourcerouting/fix/handling_dynamic_capability_mp_gr
Donald Sharp [Fri, 5 Apr 2024 17:42:03 +0000 (13:42 -0400)]
Merge pull request #15640 from opensourcerouting/fix/handling_dynamic_capability_mp_gr

bgpd: Fix errors handling for MP/GR capabilities as dynamic capability

12 months agodoc: correct a few commands for isis
anlan_cs [Fri, 5 Apr 2024 13:37:22 +0000 (21:37 +0800)]
doc: correct a few commands for isis

Correct a few commands for isis based on code, just complete the missing
`[vrf <NAME|all>]`.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agoMerge pull request #15682 from mjstapp/fix_topo_bfd_convergence
Donatas Abraitis [Fri, 5 Apr 2024 10:37:10 +0000 (13:37 +0300)]
Merge pull request #15682 from mjstapp/fix_topo_bfd_convergence

tests: increase topotest wait time for bfd convergence

12 months agoMerge pull request #15685 from anlancs/fix/ldpd-cmd-dup-label-check
Donatas Abraitis [Fri, 5 Apr 2024 10:36:56 +0000 (13:36 +0300)]
Merge pull request #15685 from anlancs/fix/ldpd-cmd-dup-label-check

zebra: cosmetic change for one flag

12 months agoMerge pull request #15672 from pguibert6WIND/isis_sr_mispelling
Donatas Abraitis [Fri, 5 Apr 2024 10:36:18 +0000 (13:36 +0300)]
Merge pull request #15672 from pguibert6WIND/isis_sr_mispelling

isisd: fix mispelling with ISIS_SR_LAN_BACKUP

12 months agozebra: cosmetic change for one flag
anlan_cs [Fri, 5 Apr 2024 04:08:58 +0000 (12:08 +0800)]
zebra: cosmetic change for one flag

Use `CHECK_FLAG()` for readability.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agoMerge pull request #15633 from pguibert6WIND/ipv4_ignore_routes_with_linkdown
Russ White [Thu, 4 Apr 2024 18:01:31 +0000 (14:01 -0400)]
Merge pull request #15633 from pguibert6WIND/ipv4_ignore_routes_with_linkdown

topotests: fix ignore routes with linkdown

12 months agotests: increase topotest wait time for bfd convergence
Mark Stapp [Thu, 4 Apr 2024 16:57:07 +0000 (12:57 -0400)]
tests: increase topotest wait time for bfd convergence

Increase the wait time in a bfd topotest; failing frequently
in the CI runs.

Signed-off-by: Mark Stapp <mjs@cisco.com>
12 months agoisisd: fix mispelling with ISIS_SR_LAN_BACKUP
Philippe Guibert [Wed, 3 Apr 2024 13:58:05 +0000 (15:58 +0200)]
isisd: fix mispelling with ISIS_SR_LAN_BACKUP

The ISIS_SR_LAN_BACKUP should be renamed to ISIS_SR_ADJ_BACKUP.

Fixes: 26f6acafc369 ("isisd: add support for segment routing")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agolib: add srv6 bsid to seg6local_context2str
Philippe Guibert [Wed, 3 Apr 2024 19:03:26 +0000 (21:03 +0200)]
lib: add srv6 bsid to seg6local_context2str

Add SRv6 Binding SID END.B6.Encaps nh6 str to lib.
It is used to display nh6 when one uses 'show ipv6 route'.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoMerge pull request #15618 from opensourcerouting/fix/bgp_optimize_suppress_path
Donald Sharp [Wed, 3 Apr 2024 12:36:31 +0000 (08:36 -0400)]
Merge pull request #15618 from opensourcerouting/fix/bgp_optimize_suppress_path

bgpd: Optimize the path for suppressed announcements

12 months agotopotests: fix ignore routes with linkdown
Philippe Guibert [Thu, 28 Mar 2024 14:56:19 +0000 (15:56 +0100)]
topotests: fix ignore routes with linkdown

In topotest, a given interface has only the ignore routes bit turned
on for IPv6 only, whereas topotest is expected to turn it on for all
address families.

> # show interface
> Interface r2-r3-eth2 is up, line protocol is up
> [..]
>  flags: <UP,BROADCAST,RUNNING,MULTICAST>
>  Ignore all v6 routes with linkdown
>  Type: Ethernet
>  [..]

This is because the only the 'default' ipv6 ignore sysctl is set to
1. Set also the /proc/sys/net/conf/<family>/default/ignore_routes_with_linkdown
flag, to have same behaviour for ipv4 and ipv6.

Fixes: 4958158787ce ("tests: micronet: update infra")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoMerge pull request #15634 from donaldsharp/suppress_fib_funny_business
Donatas Abraitis [Wed, 3 Apr 2024 06:51:29 +0000 (09:51 +0300)]
Merge pull request #15634 from donaldsharp/suppress_fib_funny_business

Suppress fib funny business

12 months agoMerge pull request #15628 from opensourcerouting/fix/bgp_prefix_sid_crash
Russ White [Tue, 2 Apr 2024 15:17:52 +0000 (11:17 -0400)]
Merge pull request #15628 from opensourcerouting/fix/bgp_prefix_sid_crash

bgpd: Fix error handling when receiving BGP Prefix SID attribute

12 months agoMerge pull request #15652 from anlancs/fix/isis-doc-timer
Igor Ryzhov [Tue, 2 Apr 2024 11:25:23 +0000 (14:25 +0300)]
Merge pull request #15652 from anlancs/fix/isis-doc-timer

doc: fix one command for isis

12 months agodoc: fix one command for isis
anlan_cs [Tue, 2 Apr 2024 06:22:14 +0000 (14:22 +0800)]
doc: fix one command for isis

Correct one command based on code.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
12 months agoMerge pull request #15636 from pguibert6WIND/resolved_prefix_bgp
Donatas Abraitis [Mon, 1 Apr 2024 21:01:34 +0000 (00:01 +0300)]
Merge pull request #15636 from pguibert6WIND/resolved_prefix_bgp

bgpd: add resolved_prefix visibility on nht

12 months agoMerge pull request #15639 from chiragshah6/fdev2
Donatas Abraitis [Mon, 1 Apr 2024 21:00:55 +0000 (00:00 +0300)]
Merge pull request #15639 from chiragshah6/fdev2

tests: add topotest for PG remote-as add del

12 months agoMerge pull request #15647 from mjstapp/fix_intf_vni_map
Igor Ryzhov [Mon, 1 Apr 2024 20:30:56 +0000 (23:30 +0300)]
Merge pull request #15647 from mjstapp/fix_intf_vni_map

zebra: don't deref vxlan-vni array

12 months agoMerge pull request #15629 from pguibert6WIND/complete_l3vpn_to_bgp
Donatas Abraitis [Mon, 1 Apr 2024 19:42:44 +0000 (22:42 +0300)]
Merge pull request #15629 from pguibert6WIND/complete_l3vpn_to_bgp

topotests: l3vpn_to_bgp_direct, complete ambiguous command 'show bgp next'

12 months agotests: add topotest for PG remote-as add del
Chirag Shah [Sat, 30 Mar 2024 01:13:47 +0000 (18:13 -0700)]
tests: add topotest for PG remote-as add del

This topotest covers the PR-15574's coverage
where a change is not to delete neighbors when
the associated peer-group's remote-as is removed.

Ticket: #3828243
Testing:

test_bgp_peer-group.py::test_bgp_peer_group

---------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------
2024-03-29 18:12:22,608 INFO: r1: checking if daemons are running
2024-03-29 18:12:22,802 INFO: r2: checking if daemons are running
2024-03-29 18:12:22,911 INFO: r3: checking if daemons are running
2024-03-29 18:12:23,015 INFO: topo: Remove bgp peer-group PG1 remote-as neighbor should be retained
2024-03-29 18:12:25,605 INFO: topo: Re-add bgp peer-group PG1 remote-as neighbor should be established

----------------------------------------------------------- generated xml file: /tmp/topotests/topotests.xml -----------------------------------------------------------
========================================================================== 2 passed in 17.63s ==========================================================================

Signed-off-by: Chirag Shah <chirag@nvidia.com>
12 months agozebra: don't deref vxlan-vni array
Mark Stapp [Mon, 1 Apr 2024 17:00:04 +0000 (13:00 -0400)]
zebra: don't deref vxlan-vni array

Null-check the vxlan-vni array info coming into zebra from
the dataplane.

Signed-off-by: Mark Stapp <mjs@cisco.com>
12 months agozebra: Fix JSON output for `show route summary json`
Donatas Abraitis [Sat, 30 Mar 2024 21:04:10 +0000 (23:04 +0200)]
zebra: Fix JSON output for `show route summary json`

Before:
```
{
  "routes":[
    {
      "fib":1,
      "rib":1,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"connected"
    },
    {
      "fib":1,
      "rib":1,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"local"
    },
    {
      "fib":2,
      "rib":2,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"static"
    }
  ],
  "routesTotal":4,
  "routesTotalFib":4
}
{
  "routes":[
    {
      "fib":2,
      "rib":2,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"connected"
    },
    {
      "fib":2,
      "rib":2,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"local"
    },
    {
      "fib":2,
      "rib":2,
      "fibOffLoaded":0,
      "fibTrapped":0,
      "type":"static"
    }
  ],
  "routesTotal":6,
  "routesTotalFib":6
}
```

After:
```
{
  "ISR":{
    "routes":[
      {
        "fib":1,
        "rib":1,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"connected"
      },
      {
        "fib":1,
        "rib":1,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"local"
      },
      {
        "fib":2,
        "rib":2,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"static"
      }
    ],
    "routesTotal":4,
    "routesTotalFib":4
  },
  "default":{
    "routes":[
      {
        "fib":2,
        "rib":2,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"connected"
      },
      {
        "fib":2,
        "rib":2,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"local"
      },
      {
        "fib":2,
        "rib":2,
        "fibOffLoaded":0,
        "fibTrapped":0,
        "type":"static"
      }
    ],
    "routesTotal":6,
    "routesTotalFib":6
  }
}
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #15632 from piotrsuchy/psuchy/fix_json_malformed_output_ip_route_s...
Donatas Abraitis [Sat, 30 Mar 2024 20:38:12 +0000 (22:38 +0200)]
Merge pull request #15632 from piotrsuchy/psuchy/fix_json_malformed_output_ip_route_show_vrf

vtysh, zebra: fix malformed json output for multiple vrfs in command 'show ip route vrf all json'

12 months agoMerge pull request #15635 from pguibert6WIND/srv6_mem_leak
Donatas Abraitis [Sat, 30 Mar 2024 15:08:24 +0000 (17:08 +0200)]
Merge pull request #15635 from pguibert6WIND/srv6_mem_leak

bgpd: fix srv6 memory leak detection

12 months agobgpd: Fix errors handling for MP/GR capabilities as dynamic capability
Donatas Abraitis [Sat, 30 Mar 2024 13:35:18 +0000 (15:35 +0200)]
bgpd: Fix errors handling for MP/GR capabilities as dynamic capability

When receiving a MP/GR capability as dynamic capability, but malformed, do not
forget to advance the pointer to avoid hitting infinity loop.

After:
```
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [GS0AQ-HKY0X] 127.0.0.1 rcv CAPABILITY
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 5, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 0
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 0, code: 0, length 1
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [HFHDS-QT71N][EC 33554494] 127.0.0.1(donatas-pc): unrecognized capability code: 0 - ignored
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:15:28 donatas-laptop bgpd[353550]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
```

Before:
```
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [Z1DRQ-N6Z5F] 127.0.0.1(donatas-pc): Dynamic Capability MultiProtocol Extensions afi/safi invalid (bad-value/unicast)
Mar 29 11:14:54 donatas-laptop bgpd[347675]: [JTVED-VGTQQ] 127.0.0.1(donatas-pc): CAPABILITY has action: 1, code: 1, length 10
```

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: add resolved_prefix visibility on nht
Philippe Guibert [Fri, 29 Mar 2024 11:07:14 +0000 (12:07 +0100)]
bgpd: add resolved_prefix visibility on nht

The nexthop tracking never displays the prefix that
has been used in ZEBRA to resolve its nexthop. This
information will be useful if some decision has to be
taken regarding any loops, that is to say if for instance
a BGP prefix is resolved over a prefix in ZEBRA that is
exactly the same.

Store the value in bgp nexthop context, and display it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agovtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route...
Piotr Suchy [Thu, 28 Mar 2024 11:55:35 +0000 (12:55 +0100)]
vtysh, zebra: Fix malformed json output for multiple vrfs in command 'show ip route vrf all json'

Command 'show ip route vrf <vrf_name> json' returns a valid json object,
however if instead of <vrf_name> we specify 'all', we get an invalid json
object, like:

{//vrf1 routes}{//vrf2 routes}{vrf3 routes}

After the fix:

{"vrf1":{//vrf1 routes},"vrf2:{//vrf2 routes},"vrf3":{//vrf3 routes}}

Which is a valid json object, that can be parsed effectively using built-in
modules. The rest of the commands remains unaffected and behave the same.

Signed-off-by: Piotr Suchy <psuchy@akamai.com>
13 months agobgpd: fix srv6 memory leak detection
Philippe Guibert [Fri, 29 Mar 2024 07:35:34 +0000 (08:35 +0100)]
bgpd: fix srv6 memory leak detection

The asan memory leak has been detected:
> Direct leak of 16 byte(s) in 1 object(s) allocated from:
>     #0 0x7f9066dadd28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
>     #1 0x7f9066779b5d in qcalloc lib/memory.c:105
>     #2 0x556d6ca527c2 in vpn_leak_zebra_vrf_sid_update_per_af bgpd/bgp_mplsvpn.c:389
>     #3 0x556d6ca530e1 in vpn_leak_zebra_vrf_sid_update bgpd/bgp_mplsvpn.c:451
>     #4 0x556d6ca64b3b in vpn_leak_postchange bgpd/bgp_mplsvpn.h:311
>     #5 0x556d6ca64b3b in vpn_leak_postchange_all bgpd/bgp_mplsvpn.c:3751
>     #6 0x556d6cb9f116 in bgp_zebra_process_srv6_locator_chunk bgpd/bgp_zebra.c:3337
>     #7 0x7f906685a6b6 in zclient_read lib/zclient.c:4490
>     #8 0x7f9066826a32 in event_call lib/event.c:2011
>     #9 0x7f906675c444 in frr_run lib/libfrr.c:1217
>     #10 0x556d6c980d52 in main bgpd/bgp_main.c:545
>     #11 0x7f9065784c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Fix this by freeing the previous memory chunk.

Fixes: b72c9e14756f ("bgpd: cli for SRv6 SID alloc to redirect to vrf (step4)")
Fixes: 527588aa78b2 ("bgpd: add support for per-VRF SRv6 SID")
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agobgpd: Prevent from one more CVE triggering this place
Donatas Abraitis [Wed, 27 Mar 2024 17:08:38 +0000 (19:08 +0200)]
bgpd: Prevent from one more CVE triggering this place

If we receive an attribute that is handled by bgp_attr_malformed(), use
treat-as-withdraw behavior for unknown (or missing to add - if new) attributes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Arrange peer notification to after zebra announce
Donald Sharp [Thu, 28 Mar 2024 16:27:38 +0000 (12:27 -0400)]
bgpd: Arrange peer notification to after zebra announce

Currently BGP attempts to send route change information
to it's peers *before* the route is installed into zebra.
This creates a bug in suppress-fib-pending in the following
scenario:

a) bgp suppress-fib-pending and bgp has a route with
2 way ecmp.
b) bgp receives a route withdraw from peer 1.  BGP
will send the route to zebra and mark the route as
FIB_INSTALL_PENDING.
c) bgp receives a route withdraw from peer 2.  BGP
will see the route has the FIB_INSTALL_PENDING and
not send the withdrawal of the route to the peer.
bgp will then send the route deletion to zebra and
clean up the bgp_path_info's.

At this point BGP is stuck where it has not sent
a route withdrawal to downstream peers.

Let's modify the code in bgp_process_main_one to
send the route notification to zebra first before
attempting to announce the route.  The route withdrawal
will remove the FIB_INSTALL_PENDING flag from the dest
and this will allow group_announce_route to believe
it can send the route withdrawal.

For the master branch this is ok because the recent
backpressure commits are in place and nothing is going
to change from an ordering perspective in that regards.
Ostensibly this fix is also for operators of Sonic and
will be backported to the 8.5 branch as well.  This will
change the order of the send to peers to be after the
zebra installation but sonic users are using suppress-fib-pending
anyways so updates won't go out until rib ack has been
received anyways.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Note when receiving but not understanding a route notification
Donald Sharp [Thu, 28 Mar 2024 16:25:05 +0000 (12:25 -0400)]
bgpd: Note when receiving but not understanding a route notification

When BGP has been asked to wait for FIB installation, on route
removal a return call is likely to not have the dest since BGP
will have cleaned up the node, entirely.  Let's just note that
the prefix cannot be found if debugs are turned on and move on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Fix error handling when receiving BGP Prefix SID attribute
Donatas Abraitis [Wed, 27 Mar 2024 16:42:56 +0000 (18:42 +0200)]
bgpd: Fix error handling when receiving BGP Prefix SID attribute

Without this patch, we always set the BGP Prefix SID attribute flag without
checking if it's malformed or not. RFC8669 says that this attribute MUST be discarded.

Also, this fixes the bgpd crash when a malformed Prefix SID attribute is received,
with malformed transitive flags and/or TLVs.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agotopotests: l3vpn_to_bgp_direct, complete ambiguous command 'show bgp next'
Philippe Guibert [Thu, 7 Mar 2024 16:12:07 +0000 (17:12 +0100)]
topotests: l3vpn_to_bgp_direct, complete ambiguous command 'show bgp next'

Complete the 'show bgp next' command expected when the l3vpn_to_bgp_direct
is executed.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
13 months agoMerge pull request #15557 from idryzhov/remove-confd
Jafar Al-Gharaibeh [Wed, 27 Mar 2024 17:38:31 +0000 (12:38 -0500)]
Merge pull request #15557 from idryzhov/remove-confd

*: remove confd plugin

13 months agoMerge pull request #15623 from Jafaral/uprev-10.0
Donatas Abraitis [Wed, 27 Mar 2024 13:12:25 +0000 (15:12 +0200)]
Merge pull request #15623 from Jafaral/uprev-10.0

debian, redhat: updating changelog for 10.0 release

13 months agodebian, redhat: updating changelog for 10.0 release
Jafar Al-Gharaibeh [Tue, 26 Mar 2024 00:30:02 +0000 (19:30 -0500)]
debian, redhat: updating changelog for 10.0 release

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
13 months agoMerge pull request #15598 from louis-6wind/fix-nhg-iface
Mark Stapp [Tue, 26 Mar 2024 15:49:03 +0000 (11:49 -0400)]
Merge pull request #15598 from louis-6wind/fix-nhg-iface

zebra: fix rejected route due to wrong nexthop-group

13 months agoMerge pull request #15585 from opensourcerouting/feature/enable_dynamic_capability_fo...
Russ White [Tue, 26 Mar 2024 14:09:50 +0000 (10:09 -0400)]
Merge pull request #15585 from opensourcerouting/feature/enable_dynamic_capability_for_datacenter_profile

bgpd: Enable BGP dynamic capability by default for datacenter profile

13 months agoMerge pull request #15525 from venko-networks/ccs/bugfix/show-ip-bgp
Russ White [Tue, 26 Mar 2024 14:04:43 +0000 (10:04 -0400)]
Merge pull request #15525 from venko-networks/ccs/bugfix/show-ip-bgp

bgpd: add missing white-space between route short status and network â€¦

13 months agoMerge pull request #15524 from raja-rajasekar/rajasekarr/backpressure_bgp_zebra_client
Russ White [Tue, 26 Mar 2024 14:03:35 +0000 (10:03 -0400)]
Merge pull request #15524 from raja-rajasekar/rajasekarr/backpressure_bgp_zebra_client

backpressure bgp zebra client

13 months agobgpd: Optimize the path for suppressed announcements
Donatas Abraitis [Tue, 26 Mar 2024 11:19:17 +0000 (13:19 +0200)]
bgpd: Optimize the path for suppressed announcements

If supress-duplicates is turned of (which is turned on by default), do not
calculate attribute hash key, that consumes CPU quite a lot.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd : backpressure - Handle BGP-Zebra Install evt Creation
Donald Sharp [Fri, 26 Jan 2024 19:48:53 +0000 (14:48 -0500)]
bgpd : backpressure - Handle BGP-Zebra Install evt Creation

BGP is now keeping a list of dests with the dest having a pointer
to the bgp_path_info that it will be working on.

1) When bgp receives a prefix, process it, add the bgp_dest of the
prefix into the new Fifo list if not present, update the flags (Ex:
earlier if the prefix was advertised and now it is a withdrawn),
increment the ref_count and DO NOT advertise the install/withdraw
to zebra yet.

2) Schedule an event to wake up to invoke the new function which will
walk the list one by one and installs/withdraws the routes into zebra.
  a) if BUFFER_EMPTY, process the next item on the list
  b) if BUFFER_PENDING, bail out and the callback in
  zclient_flush_data() will invoke the same function when BUFFER_EMPTY

Changes
 - rename old bgp_zebra_announce to bgp_zebra_announce_actual
 - rename old bgp_zebra_withdrw to bgp_zebra_withdraw_actual
 - Handle new fifo list cleanup in bgp_exit()
 - New funcs: bgp_handle_route_announcements_to_zebra() and
   bgp_zebra_route_install()
 - Define a callback function to invoke
   bgp_handle_route_announcements_to_zebra() when BUFFER_EMPTY in
   zclient_flush_data()

The current change deals with bgp installing routes via
bgp_process_main_one()

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
13 months agobgpd: backpressure - cleanup bgp_zebra_XX func args
Donald Sharp [Thu, 25 Jan 2024 18:07:37 +0000 (13:07 -0500)]
bgpd: backpressure - cleanup bgp_zebra_XX func args

Since installing/withdrawing routes into zebra is going to be changed
around to be dest based in a list,
 - Retrieve the afi/safi to use based upon the dest's afi/safi
   instead of passing it in.
 - Prefix is known by the dest. Remove this arg as well

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
13 months agobgpd: backpressure - Add a typesafe list for Zebra Announcement
Donald Sharp [Thu, 25 Jan 2024 17:53:24 +0000 (12:53 -0500)]
bgpd: backpressure - Add a typesafe list for Zebra Announcement

Modify the bgp master to hold a type safe list for bgp_dests that need
to be passed to zebra.

Future commits will use this.

Ticket: #3390099

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
13 months agoMerge pull request #15603 from idryzhov/mgmt-txn-cleanup
Donatas Abraitis [Mon, 25 Mar 2024 20:14:59 +0000 (22:14 +0200)]
Merge pull request #15603 from idryzhov/mgmt-txn-cleanup

mgmtd: remove unused event type

13 months agoMerge pull request #15609 from anlancs/fix/doc-isis-hello
Donatas Abraitis [Mon, 25 Mar 2024 11:30:03 +0000 (13:30 +0200)]
Merge pull request #15609 from anlancs/fix/doc-isis-hello

doc: fix some commands for isis

13 months agodoc: fix some commands for isis
anlan_cs [Thu, 21 Mar 2024 12:07:00 +0000 (20:07 +0800)]
doc: fix some commands for isis

Signed-off-by: anlan_cs <vic.lan@pica8.com>
13 months agoMerge pull request #15602 from idryzhov/mgmt-fix-logs
Mark Stapp [Fri, 22 Mar 2024 20:56:58 +0000 (16:56 -0400)]
Merge pull request #15602 from idryzhov/mgmt-fix-logs

mgmtd: fix a couple of log messages

13 months agomgmtd: remove unused event type
Igor Ryzhov [Fri, 22 Mar 2024 14:43:18 +0000 (16:43 +0200)]
mgmtd: remove unused event type

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agomgmtd: fix a couple of log messages
Igor Ryzhov [Fri, 22 Mar 2024 14:35:52 +0000 (16:35 +0200)]
mgmtd: fix a couple of log messages

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agoMerge pull request #15593 from LabNConsulting/acee/ospf-link-flap-ase-route-change
Mark Stapp [Fri, 22 Mar 2024 12:35:42 +0000 (08:35 -0400)]
Merge pull request #15593 from LabNConsulting/acee/ospf-link-flap-ase-route-change

ospfd: Assure OSPF AS External routes are installed after link flap

13 months agoMerge pull request #15590 from sri-mohan1/srib-24-zebra-b
Mark Stapp [Fri, 22 Mar 2024 12:33:52 +0000 (08:33 -0400)]
Merge pull request #15590 from sri-mohan1/srib-24-zebra-b

zebra: changes for code maintainability

13 months agoMerge pull request #15010 from tlsalmin/master
Mark Stapp [Fri, 22 Mar 2024 12:31:12 +0000 (08:31 -0400)]
Merge pull request #15010 from tlsalmin/master

zebra: Fix crash on macvlan link down/up

13 months agoMerge pull request #15591 from opensourcerouting/fix/housekeeping
Mark Stapp [Fri, 22 Mar 2024 11:28:43 +0000 (07:28 -0400)]
Merge pull request #15591 from opensourcerouting/fix/housekeeping

*: License housekeeping

13 months agozebra: fix rejected route due to wrong nexthop-group
Louis Scalbert [Fri, 22 Mar 2024 09:15:45 +0000 (10:15 +0100)]
zebra: fix rejected route due to wrong nexthop-group

A specific sequence of actions involving the addition and removal of IP
routes and network interfaces can lead to a route installation failure.
The issue occurs under the following conditions:

 - Initially, there is no route present via the ens3 interface.
 - Adds a route: ip route 10.0.0.0/24 192.168.0.100 ens3
 - Removes the same route: no ip route 10.0.0.0/24 192.168.0.100 ens3
 - Removes the ens3 interface.
 - Re-adds the ens3 interface.
 - Again adds the same route: ip route 10.0.0.0/24 192.168.0.100 ens3
 - And again removes it: no ip route 10.0.0.0/24 192.168.0.100 ens3
 - Shuts down the ens3 interface
 - Reactivates the interface
 - Adds the route once more: ip route 10.0.0.0/24 192.168.0.100 ens3

The route appears to be rejected.
> # show ip route nexthop
> S>r 10.0.0.0/24 [1/0] (6) via 192.168.0.100, ens3, weight 1, 00:00:01

The commit 35729f38fa ("zebra: Add a timer to nexthop group deletion")
introduced a feature to keep a nexthop-group in Zebra for a certain
period even when it is no longer in use. But if a nexthop-group
interface is removed during this period, the association between the
nexthop-group and the interface is lost in zebra memory. If the
interface is later added back and a route is re-established, the
nexthop-group interface dependency is not correctly reestablished.
As a consequence, the nexthop-group flags remain unset when the
interface is down. Upon the interface's reactivation, zebra does not
reinstall the nexthop-group in the kernel because it is marked as valid
and installed, but in reality, it does not exist in the kernel (it was
removed when the interface was down). Thus, attempts to install a route
via this nexthop-group ID fail.

Stop maintaining a nexthop-group when its associated interface is no
longer present.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
13 months agoMerge pull request #15587 from LabNConsulting/chopps/fix-grpc-protobuf
Donatas Abraitis [Fri, 22 Mar 2024 07:20:20 +0000 (09:20 +0200)]
Merge pull request #15587 from LabNConsulting/chopps/fix-grpc-protobuf

grpc: fix grpc for various failures

13 months agoospfd: Assure OSPF AS External routes are installed after link flap
Acee [Wed, 20 Mar 2024 03:34:09 +0000 (23:34 -0400)]
ospfd: Assure OSPF AS External routes are installed after link flap

OSPF intra/inter area routes were previously marked to assure they
are re-installed after a fast link flap in the commit:

commit effee18744ad3e1777614f58350d74fb718d3211
Author: Donald Sharp <sharpd@nvidia.com>
Date:   Mon May 24 13:45:29 2021 -0400

    ospfd: Fix quick interface down up event handling in ospf

This commit extends this fix to OSPF AS External routes as well.

Signed-off-by: Acee <aceelindem@gmail.com>
13 months agogrpc: fix grpc for various failures
Christian Hopps [Wed, 20 Mar 2024 19:20:18 +0000 (19:20 +0000)]
grpc: fix grpc for various failures

lib: don't define a `fallthrough` in c++ to avoid conflict with protobuf c++

check: add link libs required by some versions of grpc++ or it's dependent
linked libs

tests: don't fail the test due to known at exit memleaks
Signed-off-by: Christian Hopps <chopps@labn.net>
13 months ago*: Add missing SPDX-License-Identifier for some .c/.h files
Donatas Abraitis [Thu, 21 Mar 2024 14:46:58 +0000 (16:46 +0200)]
*: Add missing SPDX-License-Identifier for some .c/.h files

Adding them as others: GPL-2.0-or-later

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoeigrpd: Drop unused files
Donatas Abraitis [Thu, 21 Mar 2024 14:46:47 +0000 (16:46 +0200)]
eigrpd: Drop unused files

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agozebra: changes for code maintainability
sri-mohan1 [Thu, 21 Mar 2024 09:26:24 +0000 (14:56 +0530)]
zebra: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
13 months agoMerge pull request #15574 from chiragshah6/fdev2
Donatas Abraitis [Wed, 20 Mar 2024 21:07:22 +0000 (23:07 +0200)]
Merge pull request #15574 from chiragshah6/fdev2

bgpd: do not del peer upon pg remote as change

13 months agoMerge pull request #15584 from opensourcerouting/fix/remove_periodic_merge_check
Donald Sharp [Wed, 20 Mar 2024 19:03:05 +0000 (15:03 -0400)]
Merge pull request #15584 from opensourcerouting/fix/remove_periodic_merge_check

bgpd: Drop periodic merge check functions

13 months agobgpd: Enable BGP dynamic capability by default for datacenter profile
Donatas Abraitis [Sat, 9 Mar 2024 08:44:38 +0000 (10:44 +0200)]
bgpd: Enable BGP dynamic capability by default for datacenter profile

Dynamic capability provides more value without resetting the sessions for some
important other capabilities to exchange, like: graceful-restart, addpath, orf,
fqdn, etc.

Since we support it already, enable it by default.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agobgpd: Drop periodic merge check functions
Donatas Abraitis [Wed, 20 Mar 2024 14:44:13 +0000 (16:44 +0200)]
bgpd: Drop periodic merge check functions

Not used anymore. There is triggered merge check, not periodic.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agoMerge pull request #15580 from LabNConsulting/chopps/clang-format-comment
Donatas Abraitis [Wed, 20 Mar 2024 06:07:58 +0000 (08:07 +0200)]
Merge pull request #15580 from LabNConsulting/chopps/clang-format-comment

tools: add comment about checking frrbot

13 months agotools: add comment about checking frrbot
Christian Hopps [Wed, 20 Mar 2024 00:04:19 +0000 (20:04 -0400)]
tools: add comment about checking frrbot

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agoMerge pull request #15565 from LabNConsulting/chopps/code-cover
Russ White [Tue, 19 Mar 2024 21:19:45 +0000 (17:19 -0400)]
Merge pull request #15565 from LabNConsulting/chopps/code-cover

tests: enable code coverage reporting with topotests

13 months agobgpd: Adjusted topotests to reflect the new "show ip bgp" output
Cassiano Campes [Tue, 19 Mar 2024 19:35:06 +0000 (16:35 -0300)]
bgpd: Adjusted topotests to reflect the new "show ip bgp" output

Topotests changed to consider the extra wite space added in "show ip
bgp" output.

Signed-off-by: Cassiano Campes <cassiano.campes@venkonetworks.com>
13 months agobgpd: Updated topotests with new changes
Cassiano Campes [Tue, 19 Mar 2024 11:02:58 +0000 (08:02 -0300)]
bgpd: Updated topotests with new changes

Updated the topotests to contemplate the new `show ip bgp` outputs.

Signed-off-by: Cassiano Campes <cassiano.campes@venkonetworks.com>
13 months agobgpd: add missing white-space between route short status and network columns
Cassiano Campes [Tue, 12 Mar 2024 01:33:16 +0000 (22:33 -0300)]
bgpd: add missing white-space between route short status and network columns

When running `show ip bgp` command, the 'route short status' and
    'network' columns do not have white-space between them.

    Old show:
        Network          Next Hop            Metric LocPrf Weight Path
     *>i1.1.1.1/32       10.1.12.111              0    100      0 i

    New show:
         Network          Next Hop            Metric LocPrf Weight Path
     *>i 1.1.1.1/32       10.1.12.111              0    100      0 i

    Added white-space to enhance readability between them.

Signed-off-by: Cassiano Campes <cassiano.campes@venkonetworks.com>
13 months agoMerge pull request #15558 from opensourcerouting/fix/bgp_dynamic_neighbors_default_ad...
Russ White [Tue, 19 Mar 2024 14:25:29 +0000 (10:25 -0400)]
Merge pull request #15558 from opensourcerouting/fix/bgp_dynamic_neighbors_default_advertise

bgpd: Update default-originate route-map actual map structure

13 months agoMerge pull request #15555 from LabNConsulting/acee/ospf-ls-request-direct-response
Russ White [Tue, 19 Mar 2024 14:24:39 +0000 (10:24 -0400)]
Merge pull request #15555 from LabNConsulting/acee/ospf-ls-request-direct-response

ospfd: Send LS Updates in response to LS Request as unicast.

13 months agoMerge pull request #15552 from sri-mohan1/srib-24-zebra-a
Russ White [Tue, 19 Mar 2024 14:24:13 +0000 (10:24 -0400)]
Merge pull request #15552 from sri-mohan1/srib-24-zebra-a

zebra: changes for code maintainability

13 months agoMerge pull request #15533 from opensourcerouting/fix/add_paths_limit_capability_test
Russ White [Tue, 19 Mar 2024 14:18:44 +0000 (10:18 -0400)]
Merge pull request #15533 from opensourcerouting/fix/add_paths_limit_capability_test

bgpd: Add tests for Paths-Limit capability

13 months agobgpd: do not del peer upon pg remote as change
Chirag Shah [Sat, 16 Mar 2024 01:18:42 +0000 (18:18 -0700)]
bgpd: do not del peer upon pg remote as change

Currently, when peer-group remote-as is removed, it
deletes all associated neighbors.
Upon re configuring peer-group remote-as, all neighbors
needs to be reconfigured.

Instead, when peer-group remote-as is remove,
cease associated peer's connection and keep in Idle state.
When the peer-group remote-as is (re)configured, trigger
BGP Peer FSM to form neighbor.
Note the connection will be initiated after start timer
expiry.

Ticket: #3828243
Testing:

----- Peers start config ----

router bgp 65566
 bgp router-id 27.0.0.5
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor fabric remote-as external >>>>
 neighbor swp1 interface peer-group fabric
 neighbor swp1 advertisement-interval 0
 neighbor swp1 timers 3 9
 neighbor swp1 timers connect 10
 neighbor swp2 interface peer-group fabric
 neighbor swp2 advertisement-interval 0
 neighbor swp2 timers 3 9

tor(config)# router bgp 65566
tor(config-router)# no neighbor fabric remote-as external

----- Peers are retained in config ----
router bgp 65566
 bgp router-id 27.0.0.5
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor swp1 interface peer-group fabric
 neighbor swp1 advertisement-interval 0
 neighbor swp1 timers 3 9
 neighbor swp1 timers connect 10
 neighbor swp2 interface peer-group fabric
 neighbor swp2 advertisement-interval 0
 neighbor swp2 timers 3 9

----- Peers are in idle state ----
Neighbor        V  AS  MsgRcvd MsgSent TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
spine-1(swp1)   4   0       52      34      0    0    0 00:00:04         Idle        0 N/A
spine-3(swp2)   4   0       52      34      0    0    0 00:00:04         Idle        0 N/A

tor(config)# router bgp 65566
tor(config-router)# neighbor fabric remote-as external

---- after connect timer expiry forms the neighbor ----

Neighbor       V    AS MsgRcvd MsgSent TblVer InQ OutQ  Up/Down State/PfxRcd  PfxSnt Desc
spine-1(swp1)  4 64435     784     749      0   0    0 00:35:10           11       2 N/A
spine-3(swp2)  4 64435     784     749      0   0    0 00:35:10           11       2 N/A

Signed-off-by: Chirag Shah <chirag@nvidia.com>
13 months agoMerge pull request #15520 from donaldsharp/bgp_dest_dev_build
Donatas Abraitis [Mon, 18 Mar 2024 20:49:27 +0000 (22:49 +0200)]
Merge pull request #15520 from donaldsharp/bgp_dest_dev_build

bgpd: When using dev build add pointer information to %pBD

13 months agoospfd: Send LS Updates in response to LS Request as unicast.
Acee Lindem [Thu, 14 Mar 2024 10:05:27 +0000 (10:05 +0000)]
ospfd: Send LS Updates in response to LS Request as unicast.

With this fix, OSPF LS Updates sent in response to OSPF LS Requests during the DB Exchange process will be sent as unicasts. Unless the timing of multiple database exchanges coincides, there is little chance that the LSAs in the LS Update are required by OSPF routers other than the one which elicited the LS Update.

This is somewhat ambigous in RFC 2328 and two errata have been filed for clarification:

https://www.rfc-editor.org/errata/eid7850
https://www.rfc-editor.org/errata/eid7851

FRR OSPFv3 (ospf6d) already does it correctly - see ospf6_lsupdate_send_neighbor(struct event *thread). Also, if there is any doubt, one can refer to the C++ code at ospf.org (John Moy's seminal OSPF reference implementation).

Signed-off-by: Acee Lindem <acee@lindem.com>
13 months agoMerge pull request #15566 from idryzhov/daemonize-nb-logs
Donald Sharp [Mon, 18 Mar 2024 11:59:04 +0000 (07:59 -0400)]
Merge pull request #15566 from idryzhov/daemonize-nb-logs

lib: remove nb/yang memory cleanup when daemonizing

13 months agoMerge pull request #15424 from askorichenko/master
Mark Stapp [Mon, 18 Mar 2024 11:44:14 +0000 (07:44 -0400)]
Merge pull request #15424 from askorichenko/master

zebra: fix route deletion during zebra shutdown

13 months agoMerge pull request #15553 from fdumontet6WIND/as_path_loop
Donatas Abraitis [Mon, 18 Mar 2024 08:54:21 +0000 (10:54 +0200)]
Merge pull request #15553 from fdumontet6WIND/as_path_loop

bgpd: make as-path-loop-detection conform to the framework

13 months agoMerge pull request #15559 from donaldsharp/sig_event_crash_on_crash_problems
Donatas Abraitis [Mon, 18 Mar 2024 06:53:23 +0000 (08:53 +0200)]
Merge pull request #15559 from donaldsharp/sig_event_crash_on_crash_problems

lib: Prevent crash then another crash from happening

13 months agolib: remove nb/yang memory cleanup when daemonizing
Igor Ryzhov [Sun, 17 Mar 2024 20:44:28 +0000 (22:44 +0200)]
lib: remove nb/yang memory cleanup when daemonizing

We're not calling any other termination functions to free allocated
memory when daemonizing except these two. There's no reason for such an
exception, and because of these calls we have the following libyang
warnings every time FRR is started:
```
MGMTD: libyang: String "15" not freed from the dictionary, refcount 2
MGMTD: libyang: String "200" not freed from the dictionary, refcount 2
MGMTD: libyang: String "mrib-then-urib" not freed from the dictionary, refcount 2
MGMTD: libyang: String "1000" not freed from the dictionary, refcount 2
MGMTD: libyang: String "10" not freed from the dictionary, refcount 2
MGMTD: libyang: String "5" not freed from the dictionary, refcount 2
```

Remove these calls to get rid of the unnecessary warnings.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
13 months agotests: required formatting change
Christian Hopps [Sun, 17 Mar 2024 08:57:42 +0000 (04:57 -0400)]
tests: required formatting change

This code wasn't touched by the actual change; however, the formatting fix is
required.

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agotests: enable code coverage reporting with topotests
Christian Hopps [Sun, 17 Mar 2024 08:27:31 +0000 (04:27 -0400)]
tests: enable code coverage reporting with topotests

Signed-off-by: Christian Hopps <chopps@labn.net>
13 months agolib: Prevent crash then another crash from happening
Donald Sharp [Fri, 15 Mar 2024 16:10:58 +0000 (12:10 -0400)]
lib: Prevent crash then another crash from happening

When a memory operation (malloc/free/... ) causes a crash
and the call to core_handler causes another crash then
instead of actually writing a core dump the alarm is
hit and the daemon in trouble will not cause a core dump.
Modify the shutdown code to just try to dump the buffers
and leave instead of cleaning up after itself.

Back Trace:

(gdb) bt
0  0x00007f17082ec056 in __lll_lock_wait_private () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f17082fc8bd in ?? () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f17082fee8f in free () from /lib/x86_64-linux-gnu/libc.so.6
3  0x00007f170866c2ea in qfree (mt=<optimized out>, ptr=<optimized out>) at lib/memory.c:141
4  0x00007f17086c156a in zlog_tls_free (arg=0x55584f816fb0) at lib/zlog.c:390
5  zlog_tls_buffer_fini () at lib/zlog.c:346
6  0x00007f1708695e5f in core_handler (signo=11, siginfo=0x7ffd173229f0, context=<optimized out>) at lib/sigevent.c:264
7  <signal handler called>
8  0x00007f17082fd7bc in ?? () from /lib/x86_64-linux-gnu/libc.so.6
9  0x00007f17082ff6e2 in calloc () from /lib/x86_64-linux-gnu/libc.so.6
10 0x00007f1708451e78 in lh_table_new () from /lib/x86_64-linux-gnu/libjson-c.so.5
11 0x00007f170844c979 in json_object_new_object () from /lib/x86_64-linux-gnu/libjson-c.so.5
12 0x000055584e002fd9 in evpn_show_all_routes (vty=vty@entry=0x55584fb5ea00, bgp=bgp@entry=0x55584f82c600, type=<optimized out>, json=json@entry=0x55584f998130, detail=<optimized out>,
    self_orig=<optimized out>) at bgpd/bgp_evpn_vty.c:3192
13 0x000055584e009ed6 in show_bgp_l2vpn_evpn_route (self=<optimized out>, vty=0x55584fb5ea00, argc=6, argv=0x55584f998970) at bgpd/bgp_evpn_vty.c:5048
14 0x00007f170863af60 in cmd_execute_command_real (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, up_level=up_level@entry=0, filter=FILTER_RELAXED)
    at lib/command.c:1030
15 0x00007f170863b2be in cmd_execute_command (vline=vline@entry=0x55584fa87cb0, vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x0, vtysh=vtysh@entry=0) at lib/command.c:1089
16 0x00007f170863b550 in cmd_execute (vty=vty@entry=0x55584fb5ea00, cmd=cmd@entry=0x55584fb65160 "sh bgp l2vpn evpn route json", matched=matched@entry=0x0, vtysh=vtysh@entry=0)
    at lib/command.c:1257
17 0x00007f17086acc77 in vty_command (vty=vty@entry=0x55584fb5ea00, buf=0x55584fb65160 "sh bgp l2vpn evpn route json") at lib/vty.c:503
18 0x00007f17086ad444 in vty_execute (vty=vty@entry=0x55584fb5ea00) at lib/vty.c:1266
19 0x00007f17086b06c8 in vtysh_read (thread=<optimized out>) at lib/vty.c:2165
20 0x00007f17086a798d in thread_call (thread=thread@entry=0x7ffd17325ce0) at lib/thread.c:2008
21 0x00007f1708660568 in frr_run (master=0x55584f22a120) at lib/libfrr.c:1223
22 0x000055584dfc8c96 in main (argc=<optimized out>, argv=<optimized out>) at bgpd/bgp_main.c:555

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
13 months agobgpd: Update default-originate route-map actual map structure
Donatas Abraitis [Fri, 15 Mar 2024 11:49:06 +0000 (13:49 +0200)]
bgpd: Update default-originate route-map actual map structure

If using with `bgp listen range ... peer-group x`, default_rmap[afi][safi] is not
updated, and after the hard-reset in other side, this is flushed and never updated
again without restarting the sender BGP daemon.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
13 months agozebra: fix route deletion during zebra shutdown
Alexander Skorichenko [Wed, 28 Feb 2024 19:34:06 +0000 (20:34 +0100)]
zebra: fix route deletion during zebra shutdown

Split zebra's vrf_terminate() into disable() and delete() stages.
The former enqueues all events for the dplane thread.
Memory freeing is performed in the second stage.

Signed-off-by: Alexander Skorichenko <askorichenko@netgate.com>
13 months agotests: bgp_sender_as_path_loop_detection add peer-group test
Francois Dumontet [Wed, 13 Mar 2024 18:43:36 +0000 (19:43 +0100)]
tests: bgp_sender_as_path_loop_detection add peer-group test

add a tests of setting as-path-loop-detection through peer-group

Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
13 months agoMerge pull request #15545 from donaldsharp/bgp_attr_dump
Donatas Abraitis [Fri, 15 Mar 2024 07:43:45 +0000 (09:43 +0200)]
Merge pull request #15545 from donaldsharp/bgp_attr_dump

bgpd: Add some missing data to `show bgp attribute-info`