Commit Graph

35483 Commits

Author SHA1 Message Date
Donatas Abraitis
029940cd77
Merge pull request #15685 from anlancs/fix/ldpd-cmd-dup-label-check
zebra: cosmetic change for one flag
2024-04-05 13:36:56 +03:00
Donatas Abraitis
33d985705a
Merge pull request #15672 from pguibert6WIND/isis_sr_mispelling
isisd: fix mispelling with ISIS_SR_LAN_BACKUP
2024-04-05 13:36:18 +03:00
anlan_cs
9fb31c5e24 zebra: cosmetic change for one flag
Use `CHECK_FLAG()` for readability.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-05 14:30:26 +08:00
Philippe Guibert
37488b573f bgpd: fix install BGP route with appropriate colored ext. community
When receiving a BGP update that includes a colored extended community,
the nexthop is tracked in the bgp nexthop tracking context, but the
color is never recorded. Adding to this, the BGP route is not prevented
from being installed without hte color.

Actually, the srte color is set only when the SRTE_COLOR attribute is set.
And that attribute value is only set when an ext. community is locally
created, or an srte value is set, but not when a BGP update with a color
ext. community is received.

Fix this by setting the SRTE_COLOR attribute on this last case.

Fixes: 442e2edcfa ("bgpd: add functions related to srte_color management")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-04 22:10:33 +02:00
Russ White
51afc9e31f
Merge pull request #15633 from pguibert6WIND/ipv4_ignore_routes_with_linkdown
topotests: fix ignore routes with linkdown
2024-04-04 14:01:31 -04:00
Mark Stapp
c4188c74be 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>
2024-04-04 12:57:07 -04:00
Philippe Guibert
2e1be61b08 isisd: fix mispelling with ISIS_SR_LAN_BACKUP
The ISIS_SR_LAN_BACKUP should be renamed to ISIS_SR_ADJ_BACKUP.

Fixes: 26f6acafc3 ("isisd: add support for segment routing")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-04 15:10:47 +02:00
Philippe Guibert
6f45349197 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>
2024-04-03 21:03:26 +02:00
Donald Sharp
3d66dd3e86
Merge pull request #15618 from opensourcerouting/fix/bgp_optimize_suppress_path
bgpd: Optimize the path for suppressed announcements
2024-04-03 08:36:31 -04:00
Philippe Guibert
c2e0060495 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: 4958158787 ("tests: micronet: update infra")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-04-03 14:35:51 +02:00
Donatas Abraitis
27cc9ae508
Merge pull request #15634 from donaldsharp/suppress_fib_funny_business
Suppress fib funny business
2024-04-03 09:51:29 +03:00
Acee Lindem
58e623714b ospfd: Implement non-broadcast support for point-to-multipoint networks
This extends non-broadcast support to point-to-multipoint networks.
Neighbors will be explicitly configured and polled in lieu of multicast
dicovery. Toptotests and documentation updates are included.

Additionally, the ospf neighbor commands have been greatly simplified taking
advantage of DEFPY() capabilities.

The AllOSPFRouters (224.0.0.5) is still joined for non-broadcast networks
since it is joined for NBMA networks. It seems this could be removed but
it should done be in a separate commit.

Signed-off-by: Acee Lindem <acee@lindem.com>
2024-04-02 21:34:29 +00:00
Russ White
6bea75f18c
Merge pull request #15628 from opensourcerouting/fix/bgp_prefix_sid_crash
bgpd: Fix error handling when receiving BGP Prefix SID attribute
2024-04-02 11:17:52 -04:00
Igor Ryzhov
c3d34b84f3 isisd: fix ip/ipv6 reachability tlvs
Don't allocate subtlvs container if there's nothing to add to it. If the
container is allocated, the "sub-TLVs presence" bit is set in the TLVs
even if there's no actual sub-TLVs, what violates the RFC.

Fixes #14514.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-02 14:48:52 +03:00
Igor Ryzhov
a6191348f8
Merge pull request #15652 from anlancs/fix/isis-doc-timer
doc: fix one command for isis
2024-04-02 14:25:23 +03:00
anlan_cs
b5ed504096 doc: fix one command for isis
Correct one command based on code.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2024-04-02 15:00:20 +08:00
Donatas Abraitis
c7fde7a32e
Merge pull request #15636 from pguibert6WIND/resolved_prefix_bgp
bgpd: add resolved_prefix visibility on nht
2024-04-02 00:01:34 +03:00
Donatas Abraitis
6d237c2fa5
Merge pull request #15639 from chiragshah6/fdev2
tests: add topotest for PG remote-as add del
2024-04-02 00:00:55 +03:00
Igor Ryzhov
4dc4c2eacc
Merge pull request #15647 from mjstapp/fix_intf_vni_map
zebra: don't deref vxlan-vni array
2024-04-01 23:30:56 +03:00
Donatas Abraitis
c461586d5c
Merge pull request #15629 from pguibert6WIND/complete_l3vpn_to_bgp
topotests: l3vpn_to_bgp_direct, complete ambiguous command 'show bgp next'
2024-04-01 22:42:44 +03:00
Donald Sharp
f3575f61c7 bgpd: Sort the bgp_path_info's
Currently bgp_path_info's are stored in reverse order
received.  Sort them by the best path ordering.

This will allow for optimizations in the future on
how multipath is done.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 14:54:02 -04:00
Chirag Shah
ede6e911b0 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>
2024-04-01 10:29:46 -07:00
Mark Stapp
75ef259b1d 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>
2024-04-01 13:00:04 -04:00
Donald Sharp
6ebb7add1f bgpd: Do not reap, schedule for deletion
Do not reap instead let's schedule for deletion
and let best_path_selection take care of the deletion
as it should.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
fca805972d bgpd: bgp_best_selection is inherently pi based
Currently evpn code calls bgp_best_selection for local
decisions for local tables to figure out what to do.
This is also pi based so let's note that the pi has
been changed before calling bgp_best_selection.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
ab49fc9c48 bgpd: Add pi to bgp_process
This will allow a consistency of approach to adding/removing
pi's to from the workqueue for processing as well as properly
handling the dest->info pi list more appropriately.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
04936ab84a bgpd: Call bgp_process when bgp_path_info_delete is called
bgp_damp.c has an instance of bgp_path_info_delete is called.
Thus setting up the path info for deletion, but since it never
calls bgp_process, it can never be deleted.  This means that in
a dampening situation, after a withdrawal the path_info would
stick around.  Schedule the path for deletion.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
6c8bfaa66e bgpd: Add BGP_PATH_UNSORTED for future commits
Add a new flag BGP_PATH_UNSORTED to keep track
of sorted -vs- unsorted path_info's.  Add some
ability to the system to understand when that
flag is set.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
19fc4e7999 bgpd: Add a path_info_flags dumper for bgp
Add a debug function to allow developers to dump flags
associated with a bgp_path_info in a human readable format.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
1389316cf7 bgpd: Fix indentation problem in bgp_recalculate_afi_safi_bestpaths
This is seriously indented.  Let's make it a bit better.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
f4fd5c8e36 bgpd: Modify update_evpn_type5_route_entry to include path_info pointer
Modify update_evpn_type5_route_entry to return a pointer to the
struct bgp_path_info modified in this function.  This code
merely follows the standards used in other bgp_evpn.c code
where the update function returns the pointer to the path
info.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
829a2e9bc4 tests: teste_ospf_rte_calc.py uses bgp add pytest mark
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donald Sharp
4d4c3966c9 tests: Explicitly call out bgp timers for bgp_evpn_mh test
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2024-04-01 10:24:14 -04:00
Donatas Abraitis
ca13121849 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>
2024-03-30 23:04:10 +02:00
Donatas Abraitis
3a9c16ae4a
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'
2024-03-30 22:38:12 +02:00
Donatas Abraitis
10053feb8a
Merge pull request #15635 from pguibert6WIND/srv6_mem_leak
bgpd: fix srv6 memory leak detection
2024-03-30 17:08:24 +02:00
Donatas Abraitis
30a332dad8 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>
2024-03-30 16:15:08 +02:00
Philippe Guibert
e20faa9fe0 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>
2024-03-29 17:20:31 +01:00
Piotr Suchy
0e2fc3d67f 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>
2024-03-29 14:01:21 +01:00
Philippe Guibert
eea8a8ae24 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: b72c9e1475 ("bgpd: cli for SRv6 SID alloc to redirect to vrf (step4)")
Fixes: 527588aa78 ("bgpd: add support for per-VRF SRv6 SID")

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2024-03-29 10:28:45 +01:00
Donatas Abraitis
babb23b748 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>
2024-03-29 09:13:11 +02:00
Donald Sharp
329d5a5cbb 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>
2024-03-28 12:27:38 -04:00
Donald Sharp
7c60314652 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>
2024-03-28 12:25:05 -04:00
Donatas Abraitis
ba6a8f1a31 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>
2024-03-28 17:26:00 +02:00
Philippe Guibert
707bd3598c 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>
2024-03-27 21:33:01 +01:00
Jafar Al-Gharaibeh
d5f17cd51e
Merge pull request #15557 from idryzhov/remove-confd
*: remove confd plugin
2024-03-27 12:38:31 -05:00
Donatas Abraitis
d7f6d0dc4e
Merge pull request #15623 from Jafaral/uprev-10.0
debian, redhat: updating changelog for 10.0 release
2024-03-27 15:12:25 +02:00
Jafar Al-Gharaibeh
b27281d0bc debian, redhat: updating changelog for 10.0 release
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2024-03-26 23:02:38 -05:00
Mark Stapp
498967799d
Merge pull request #15598 from louis-6wind/fix-nhg-iface
zebra: fix rejected route due to wrong nexthop-group
2024-03-26 11:49:03 -04:00
Igor Ryzhov
1046bef240 tests: add topotest for mgmt native edit command
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-26 17:00:15 +02:00