]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
12 months agoripd: fix another memtype mismatch
Renato Westphal [Mon, 8 May 2023 14:07:54 +0000 (11:07 -0300)]
ripd: fix another memtype mismatch

Fixes #13447.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
12 months agoMerge pull request #13446 from louis-6wind/fix-ext-comm
Donatas Abraitis [Mon, 8 May 2023 10:44:56 +0000 (13:44 +0300)]
Merge pull request #13446 from louis-6wind/fix-ext-comm

bgpd: fix show running of nt extcommunity

12 months agoMerge pull request #13440 from zice312963205/bgpfix
Donatas Abraitis [Mon, 8 May 2023 08:47:14 +0000 (11:47 +0300)]
Merge pull request #13440 from zice312963205/bgpfix

bgpd: fix the issue of connected tag error when BGP subscribes to NHT…

12 months agoMerge pull request #13458 from sri-mohan1/srib-ldpd
Donatas Abraitis [Mon, 8 May 2023 07:22:27 +0000 (10:22 +0300)]
Merge pull request #13458 from sri-mohan1/srib-ldpd

ldpd: changes for code maintainability

12 months agoldpd: changes for code maintainability
sri-mohan1 [Sun, 7 May 2023 15:30:52 +0000 (21:00 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
12 months agoMerge pull request #13455 from sri-mohan1/srib-ldpd
Donatas Abraitis [Sat, 6 May 2023 19:47:27 +0000 (22:47 +0300)]
Merge pull request #13455 from sri-mohan1/srib-ldpd

ldpd: changes for code maintainability

12 months agoldpd: changes for code maintainability
sri-mohan1 [Sat, 6 May 2023 14:22:34 +0000 (19:52 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
12 months agoMerge pull request #13451 from sri-mohan1/srib-ldpd
Donald Sharp [Sat, 6 May 2023 12:49:24 +0000 (08:49 -0400)]
Merge pull request #13451 from sri-mohan1/srib-ldpd

ldpd: changes for code maintainability

12 months agoMerge pull request #13424 from LabNConsulting/chopps/log-config-file-cmds
Donald Sharp [Sat, 6 May 2023 10:47:05 +0000 (06:47 -0400)]
Merge pull request #13424 from LabNConsulting/chopps/log-config-file-cmds

12 months agobgpd: fix the issue of connected tag error when BGP subscribes to NHT from Zebra
Jack.zhang [Fri, 5 May 2023 06:58:32 +0000 (14:58 +0800)]
bgpd: fix the issue of connected tag error when BGP subscribes to NHT from Zebra

Imagine the following scenario:
1.Create a multihop ebgp peer and config the ttl as 254 for both side.
2.Call bgp_start and start an active connection.
Bgp will send a nht register with non-connected flag.
3.The function bgp_accept be called by remote connection.
Bgp will create a accept peer as a passive connection with default ttl(1). And then will send a nht register again with connected flag. This register result will cover the first one.
4.The active connection come to establish first. In funciton "peer_xfer_conn", check for "PEER_FLAG_CONFIG_NODE" flag of "from_peer->doppelganger" will not be pass, so we can not repair the nht register error forever.
Then the bgp nexthop will be like this:
2000::60 invalid, #paths 0, peer 2000::60
Must be Connected
Last update: Thu May 4 09:35:14 2023

The route from this peer can not be treat with a vaild nexthop forever.
This change will fix this error.

Signed-off-by: Jack.zhang <hanyu.zly@alibaba-inc.com>
12 months agoldpd: changes for code maintainability
sri-mohan1 [Fri, 5 May 2023 18:11:01 +0000 (23:41 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
12 months agobgpd: fix show running of nt extcommunity
Louis Scalbert [Fri, 5 May 2023 14:05:42 +0000 (16:05 +0200)]
bgpd: fix show running of nt extcommunity

Setting

> bgp extcommunity-list standard EXT seq 5 permit nt 192.168.1.3:0

results in:

> bgp extcommunity-list standard EXT seq 5 permit NT:192.168.1.3

Fix the display

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoMerge pull request #13436 from donaldsharp/ospf_json_mem_leak
Donatas Abraitis [Fri, 5 May 2023 12:14:16 +0000 (15:14 +0300)]
Merge pull request #13436 from donaldsharp/ospf_json_mem_leak

ospfd: Fix memory leaks w/ `show ip ospf int X json` commands

12 months agoMerge pull request #13428 from opensourcerouting/ripd-bfd-fixes
Donald Sharp [Fri, 5 May 2023 12:04:57 +0000 (08:04 -0400)]
Merge pull request #13428 from opensourcerouting/ripd-bfd-fixes

ripd: fix problemas

12 months agoMerge pull request #13435 from mjstapp/fix_pim_cpp_notice
Donald Sharp [Fri, 5 May 2023 12:04:23 +0000 (08:04 -0400)]
Merge pull request #13435 from mjstapp/fix_pim_cpp_notice

pimd: replace CPP_NOTICE lines with TODO comments

12 months agoMerge pull request #13423 from LabNConsulting/chopps/coverity-string-fix
Donald Sharp [Fri, 5 May 2023 11:35:06 +0000 (07:35 -0400)]
Merge pull request #13423 from LabNConsulting/chopps/coverity-string-fix

mgmtd: simplify commit id to just be a timeval string

12 months agolib: log commands read from config file
Christian Hopps [Wed, 3 May 2023 04:41:19 +0000 (00:41 -0400)]
lib: log commands read from config file

When the user specifies `--command-log-always` in CLI arguments then also log
commands executed from loading the config file.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agomgmtd: simplify commit id to just be a timeval string
Christian Hopps [Tue, 2 May 2023 21:17:51 +0000 (17:17 -0400)]
mgmtd: simplify commit id to just be a timeval string

Also fixes coverity warning

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13357 from Jafaral/fix_ospf_prop
Christian Hopps [Thu, 4 May 2023 18:46:56 +0000 (14:46 -0400)]
Merge pull request #13357 from Jafaral/fix_ospf_prop

tests: clear the ospf neighbor to force a state change

12 months agoospfd: Fix memory leaks w/ `show ip ospf int X json` commands
Donald Sharp [Thu, 4 May 2023 16:53:42 +0000 (12:53 -0400)]
ospfd: Fix memory leaks w/ `show ip ospf int X json` commands

FRR has a memory leak in the case when int X does not
exist and a memory leak when int X does exist.  Fix
these

Fixes: #13434
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agopimd: replace CPP_NOTICE lines with TODO comments
Mark Stapp [Thu, 4 May 2023 14:26:33 +0000 (10:26 -0400)]
pimd: replace CPP_NOTICE lines with TODO comments

Replace the noisy CPP_NOTICE lines with TODO comments.

Signed-off-by: Mark Stapp <mjs@labn.net>
12 months agotests: clear the ospf neighbor to force a state change
Jafar Al-Gharaibeh [Sat, 22 Apr 2023 18:10:16 +0000 (13:10 -0500)]
tests: clear the ospf neighbor to force a state change

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
12 months agoripd: use correct memory type when freeing BFD profile
Renato Westphal [Wed, 3 May 2023 20:02:58 +0000 (17:02 -0300)]
ripd: use correct memory type when freeing BFD profile

Fixes #13415.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
12 months agoripd: fix null-pointer dereference
Renato Westphal [Wed, 3 May 2023 20:01:36 +0000 (17:01 -0300)]
ripd: fix null-pointer dereference

Fixes #13416.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
12 months agoMerge pull request #13425 from FRRouting/revert-12646-mpls_alloc_per_nh
Donald Sharp [Wed, 3 May 2023 11:35:37 +0000 (07:35 -0400)]
Merge pull request #13425 from FRRouting/revert-12646-mpls_alloc_per_nh

Revert "MPLS allocation mode per next hop"

12 months agoRevert "MPLS allocation mode per next hop"
Donatas Abraitis [Wed, 3 May 2023 10:50:26 +0000 (13:50 +0300)]
Revert "MPLS allocation mode per next hop"

Broken tests, let's revert now.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #13422 from donaldsharp/pim_thread_off_fix
Mark Stapp [Tue, 2 May 2023 18:57:25 +0000 (14:57 -0400)]
Merge pull request #13422 from donaldsharp/pim_thread_off_fix

pimd: Fix old commit that got in

12 months agopimd: Fix old commit that got in
Donald Sharp [Tue, 2 May 2023 18:49:32 +0000 (14:49 -0400)]
pimd: Fix old commit that got in

An old fix that used THREAD_OFF was pushed in, should
have used EVENT_OFF instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13020 from SaiGomathiN/2462808-3
Donald Sharp [Tue, 2 May 2023 15:55:34 +0000 (11:55 -0400)]
Merge pull request #13020 from SaiGomathiN/2462808-3

pimd: PIM not sending register packets after changing from non DR to DR

12 months agoMerge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh
Donatas Abraitis [Tue, 2 May 2023 15:36:45 +0000 (18:36 +0300)]
Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh

MPLS allocation mode per next hop

12 months agoMerge pull request #13376 from louis-6wind/fix-flex-algo-mem-leak
Russ White [Tue, 2 May 2023 15:33:38 +0000 (11:33 -0400)]
Merge pull request #13376 from louis-6wind/fix-flex-algo-mem-leak

isisd, lib: fix flex-algo memory leak

12 months agoMerge pull request #13366 from zmw12306/rte_tag
Donatas Abraitis [Tue, 2 May 2023 14:56:09 +0000 (17:56 +0300)]
Merge pull request #13366 from zmw12306/rte_tag

ripd: add non-zero check for RIPv1 reserved field

12 months agoMerge pull request #13403 from anlancs/fix/zebra-missing-vrf-flag
Russ White [Tue, 2 May 2023 14:47:41 +0000 (10:47 -0400)]
Merge pull request #13403 from anlancs/fix/zebra-missing-vrf-flag

zebra: Fix missing VRF flag

12 months agoMerge pull request #13404 from louis-6wind/fix-flex-algo-race-condition
Russ White [Tue, 2 May 2023 14:42:39 +0000 (10:42 -0400)]
Merge pull request #13404 from louis-6wind/fix-flex-algo-race-condition

isisd: fix a flex algo race condition and a minor fix

12 months agoMerge pull request #13235 from Orange-OpenSource/link-state
Russ White [Tue, 2 May 2023 14:31:10 +0000 (10:31 -0400)]
Merge pull request #13235 from Orange-OpenSource/link-state

lib: Fix memory leaks in Link State library

12 months agoMerge pull request #13270 from pguibert6WIND/better_srv6_output_seg6local
Russ White [Tue, 2 May 2023 14:30:15 +0000 (10:30 -0400)]
Merge pull request #13270 from pguibert6WIND/better_srv6_output_seg6local

zebra: display seg6local only when specified

12 months agoMerge pull request #13354 from zmw12306/parse_request_subtlv
Russ White [Tue, 2 May 2023 14:28:20 +0000 (10:28 -0400)]
Merge pull request #13354 from zmw12306/parse_request_subtlv

babeld: add parse_request_subtlv into parse_packet

12 months agoMerge pull request #13377 from donaldsharp/ospf_dead_interval
Russ White [Tue, 2 May 2023 14:25:46 +0000 (10:25 -0400)]
Merge pull request #13377 from donaldsharp/ospf_dead_interval

tests: Increase the dead interval to be longer for neighbor testing

12 months agoMerge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt
Donald Sharp [Tue, 2 May 2023 13:21:24 +0000 (09:21 -0400)]
Merge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt

pimd: Fix wrong setsockopt() call

12 months agoMerge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_noti...
Donald Sharp [Tue, 2 May 2023 12:42:43 +0000 (08:42 -0400)]
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification

tests: Do not try establishing a connection from r1 to r2

12 months agoMerge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
Donald Sharp [Tue, 2 May 2023 12:17:17 +0000 (08:17 -0400)]
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags

mgmtd: fully implement debug flags for mgmtd and clients

12 months agoMerge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto
Donatas Abraitis [Mon, 1 May 2023 19:07:03 +0000 (22:07 +0300)]
Merge pull request #13405 from dmytroshytyi-6WIND/srv6_bgp_no_sid_export_auto

bgpd, tests: srv6 "no sid vpn export auto" per AF in vtysh

12 months agoMerge pull request #13408 from pguibert6WIND/flowspec_sanity
Donatas Abraitis [Mon, 1 May 2023 18:58:53 +0000 (21:58 +0300)]
Merge pull request #13408 from pguibert6WIND/flowspec_sanity

bgpd: add some flowspec sanity returns

12 months agoMerge pull request #13409 from chiragshah6/fdev1
Donatas Abraitis [Mon, 1 May 2023 18:55:38 +0000 (21:55 +0300)]
Merge pull request #13409 from chiragshah6/fdev1

zebra:add df flag into evpn esi json output

12 months agomgmtd: fully implement debug flags for mgmtd and clients
Christian Hopps [Wed, 26 Apr 2023 21:50:46 +0000 (17:50 -0400)]
mgmtd: fully implement debug flags for mgmtd and clients

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
Donald Sharp [Mon, 1 May 2023 13:51:46 +0000 (09:51 -0400)]
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt

startup log timestamp precision build option

12 months agozebra: Fix missing VRF flag
anlan_cs [Fri, 28 Apr 2023 05:39:59 +0000 (13:39 +0800)]
zebra: Fix missing VRF flag

1. No any configuration in FRR, and `ip link add vrf1 type vrf ...`.
Currently, everything is ok.

2.  `ip link del vrf1`.
`zebra` will wrongly/redundantly notify clients to add "vrf1" as a normal
interface after correct deletion of "vrf1".

```
ZEBRA: [KMXEB-K771Y] netlink_parse_info: netlink-listen (NS 0) type RTM_DELLINK(17), len=588, seq=0, pid=0
ZEBRA: [TDJW2-B9KJW] RTM_DELLINK for vrf1(93) <- Wrongly as normal interface, not vrf
ZEBRA: [WEEJX-M4HA0] interface vrf1 vrf vrf1(93) index 93 is now inactive.
ZEBRA: [NXAHW-290AC] MESSAGE: ZEBRA_INTERFACE_DELETE vrf1 vrf vrf1(93)
ZEBRA: [H97XA-ABB3A] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL vrf1 VRF Id 93 -> 0
ZEBRA: [HP8PZ-7D6D2] MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD vrf1 VRF Id 93 -> 0 <-
ZEBRA: [Y6R2N-EF2N4] interface vrf1 is being deleted from the system
ZEBRA: [KNFMR-AFZ53] RTM_DELLINK for VRF vrf1(93)
ZEBRA: [P0CZ5-RF5FH] VRF vrf1 id 93 is now inactive
ZEBRA: [XC3P3-1DG4D] MESSAGE: ZEBRA_VRF_DELETE vrf1
ZEBRA: [ZMS2F-6K837] VRF vrf1 id 4294967295 deleted
OSPF: [JKWE3-97M3J] Zebra: interface add vrf1 vrf default[0] index 0 flags 480 metric 0 mtu 65575 speed 0 <- Wrongly add interface
```

`if_handle_vrf_change()` moved the interface from specific vrf to default
vrf. But it doesn't skip interface of vrf type. So, the wrong/redundant
add operation is done.

Note, the wrong add operation is regarded as an normal interface because
the `ifp->status` is cleared too early, so it is without VRF flag
( `ZEBRA_INTERFACE_VRF_LOOPBACK` ). Now, ospfd will initialize `ifp->type`
to `OSPF_IFTYPE_BROADCAST`.

3. `ip link add vrf1 type vrf ...`, add "vrf1" again. FRR will be with
wrong display:

```
interface vrf1
 ip ospf network broadcast
exit
```

Here, zebra will send `ZEBRA_INTERFACE_ADD` again for "vrf1" with
correct `ifp->status`, so it will be updated into vrf type. But
it can't update `ifp->type` from `OSPF_IFTYPE_BROADCAST` to
`OSPF_IFTYPE_LOOPBACK` because it had been already configured in above
step 2.

Two changes to fix it:

1. Skip the procedure of switching VRF for interfaces of vrf type.
It means, don't send `ZEBRA_INTERFACE_ADD` to clients when deleting vrf.

2. Put the deletion of this flag at the last.
It means, clients should get correct `ifp->status`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
12 months agotests: change topotest log timestamp precision to 6.
Christian Hopps [Fri, 28 Apr 2023 15:11:41 +0000 (11:11 -0400)]
tests: change topotest log timestamp precision to 6.

- Often millisecond precision is not good enough to differentiate things that
occur directly one after another, and things that have some pause in between,
increase to microsecond precision (reporting)

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agolib: add build option to set startup log timestemp precision
Christian Hopps [Fri, 28 Apr 2023 15:10:56 +0000 (11:10 -0400)]
lib: add build option to set startup log timestemp precision

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agozebra:add df flag into evpn esi json output
Sindhu Parvathi Gopinathan [Fri, 28 Apr 2023 12:28:58 +0000 (05:28 -0700)]
zebra:add df flag into evpn esi json output

FRR "show evpn es 'esi-id' json" output dont have the 'df' flag.

Modified the code to add the 'df' flag into json output.

Before Fix:

```
torm-11# show evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "accessPort":"hostbond1",
  "flags":[
    "local",
    "remote",
    "readyForBgp",
    "bridgePort",
    "operUp",
    "nexthopGroupActive"
 ====================> df is missing
  ],
  "vniCount":10,
  "macCount":13,
  "dfPreference":50000,
  "nexthopGroup":536870913,
  "vteps":[
    {
      "vtep":"27.0.0.16",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435460
    },
    {
      "vtep":"27.0.0.17",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435461
    }
  ]
}
torm-11#
```

After Fix:-

```
torm-11# show evpn es 03:44:38:39:ff:ff:01:00:00:01 json
{
  "esi":"03:44:38:39:ff:ff:01:00:00:01",
  "accessPort":"hostbond1",
  "flags":[
    "local",
    "remote",
    "readyForBgp",
    "bridgePort",
    "operUp",
    "nexthopGroupActive",
    "df" ========================> designated-forward flag added
  ],
  "vniCount":10,
  "macCount":13,
  "dfPreference":50000,
  "nexthopGroup":536870913,
  "vteps":[
    {
      "vtep":"27.0.0.16",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435460
    },
    {
      "vtep":"27.0.0.17",
      "dfAlgorithm":"preference",
      "dfPreference":32767,
      "nexthopId":268435461
    }
  ]
}
torm-11#

```

Ticket:# 3447935

Issue: 3447935

Testing: UT done

Signed-off-by: Sindhu Parvathi Gopinathan's <sgopinathan@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
12 months agotests: validate sid export per-vrf and per-af
Dmytro Shytyi [Fri, 21 Apr 2023 12:24:33 +0000 (14:24 +0200)]
tests: validate sid export per-vrf and per-af

Verify activation and desactivation of per-vrf and per-af
sid export. Modify the configuration of r2 and verify that
changes are reflected in r1 and on connectivity between ce1 and c2.

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
12 months agobgpd: implement "no sid vpn export auto" per AF in vtysh
Dmytro Shytyi [Fri, 21 Apr 2023 12:00:48 +0000 (14:00 +0200)]
bgpd: implement "no sid vpn export auto" per AF in vtysh

An example of implemented command for IPv4 AF is presented below.

dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
dev-vm(config-router-af)# sid vpn export auto
^^^<<<<<<<<<<<<<<<<<<<<<< 1. configure sid per af
dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
- sid: 2001:db8:2:5:1::
  locator: Locator1
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: 2001:db8:2:5:1::
^^^<<<<<<<<<<<<<<<<<<<<< 2. sid is configured
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
dev-vm(config-router-af)# no sid vpn export auto
^^^<<<<<<<<<<<<<<<<<<<< 3. deconfigure sid per af
dev-vm(config-router-af)# do show bgp segment-routing srv6
locator_name: Locator1
locator_chunks:
- 2001:db8:2:5::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
functions:
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: (null)
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)
- name: red
  vpn_policy[AFI_IP].tovpn_sid: (null)
^^^<<<<<<<<<<<<<<<<<<< 4. sid is deconfigured
  vpn_policy[AFI_IP6].tovpn_sid: (null)
  per-vrf tovpn_sid: (null)

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
12 months agobgpd: add some flowspec sanity returns
Philippe Guibert [Fri, 28 Apr 2023 19:56:19 +0000 (21:56 +0200)]
bgpd: add some flowspec sanity returns

If an error is detected in an NLRI, immediately return
an error, when there is a risk of buffer overflow.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoMerge pull request #13407 from cscarpitta/fix/fix-srv6l3vpn-topotest
Donald Sharp [Fri, 28 Apr 2023 17:49:06 +0000 (13:49 -0400)]
Merge pull request #13407 from cscarpitta/fix/fix-srv6l3vpn-topotest

tests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest

12 months agotests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest
Carmine Scarpitta [Fri, 28 Apr 2023 15:11:32 +0000 (17:11 +0200)]
tests: Fix `bgp_srv6l3vpn_to_bgp_vrf3` topotest

The `bgp_srv6l3vpn_to_bgp_vrf3` topotest tests the SRv6 L3VPN
functionality. It applies the appropriate configuration in `bgpd` and
`zebra`, and then checks that the RIB is updated correctly.

The topotest expects to find the AS-Path in the RIB, which is only
present if the `bgp send-extra-data zebra` option is enabled in the
`bgpd` configuration.

The `bgp send-extra-data zebra` option has been accidentally commented
out in commit https://github.com/FRRouting/frr/commit/2007e2dbd0d5c42d9fe6cbe92b34be10654834ef.

This commit fixes the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by re-adding
the missing `bgp send-extra-data zebra` option.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
12 months agoMerge pull request #13335 from pguibert6WIND/bgp_lu_explicit_per_afi
Donatas Abraitis [Fri, 28 Apr 2023 13:27:20 +0000 (16:27 +0300)]
Merge pull request #13335 from pguibert6WIND/bgp_lu_explicit_per_afi

bgpd: configure explicit-null for local paths per address family

12 months agolib: fix comparaison of flex-algo definition
Louis Scalbert [Fri, 28 Apr 2023 09:20:50 +0000 (11:20 +0200)]
lib: fix comparaison of flex-algo definition

Fix comparaison of flex-algo definition by comparing all the definition
statements.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoisisd: fix disabled flex-algo on race condition
Louis Scalbert [Fri, 28 Apr 2023 09:20:26 +0000 (11:20 +0200)]
isisd: fix disabled flex-algo on race condition

A particular flex-algo algorithm may remain in disabled state after
configuring it if its flex-algo definition is being spread in the area.

It happens sometimes that, in isis_sr_flex_algo_topo1 topotest, r3
flex-algo 203 is disabled on test8. It depends on the following
sequence on r3:
 1. a LSP containing the flex-algo 203 definition is received from
    either r1 or r2 (or both).
 2. the local LSP is rebuilt by lsp_build() because of the flex-algo 203
    configuration
 3. isis_run_spf() recomputes the algo 203 SPF tree

A 1. 2. 3. sequence results in a working test whereas 2. 1. 3. is not
working. The second case issue is because of an inconsistent flex-algo
definition state between the following:
 - in lsp_build(), isis_flex_algo_elected_supported_local_fad() returns
   false because no flex-algo definition is known.
 - in isis_run_spf(), isis_flex_algo_elected_supported() returns true
   because a flex-algo definition is found.

Set a flex-algo state lsp_build() depending on flex-algo definition
existence that is used later in isis_run_spf().

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoMerge pull request #13379 from pguibert6WIND/bgp_nht_must_equal_zebra_nht
Donatas Abraitis [Fri, 28 Apr 2023 06:32:24 +0000 (09:32 +0300)]
Merge pull request #13379 from pguibert6WIND/bgp_nht_must_equal_zebra_nht

bgpd: keep interface index on bgp nexthop tracking

12 months agobgpd: configure explicit-null for local paths per address family
Philippe Guibert [Wed, 19 Apr 2023 14:40:50 +0000 (16:40 +0200)]
bgpd: configure explicit-null for local paths per address family

Until now, the bgp local paths were using the default null label
defined. It was not possible to select the null label for the ipv4
or the ipv6 address families.

This commit addresses this issues by adding two extra-parameters
to the BGP labeled-unicast command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agobgpd: keep interface index on bgp nexthop tracking
Philippe Guibert [Mon, 24 Apr 2023 20:33:15 +0000 (22:33 +0200)]
bgpd: keep interface index on bgp nexthop tracking

The following BGP configuration does not show that the
resolved next-hop to 192.0.2.1 has a defined interface.

> router bgp 65500
>  bgp router-id 192.0.2.2
>  neighbor 192.0.2.1 remote-as 65500
>  neighbor 192.0.2.1 update-source loop1
>  neighbor 192.168.0.1 remote-as 65500
>  !
>  address-family ipv4 unicast
>   network 192.0.2.2/32
>   no neighbor 192.168.0.1 activate
>  exit-address-family
>  !
>  address-family ipv4 labeled-unicast
>   neighbor 192.168.0.1 activate
>  exit-address-family
>  !
>  address-family ipv4 vpn
>   neighbor 192.0.2.1 activate
>  exit-address-family

The 'show bgp nexthop' dump does not output the interface
whereas the zebra rnh has the information.

> dut-vm# show bgp nexthop
> [..]
> Current BGP nexthop cache:
>  192.0.2.1 valid [IGP metric 0], #paths 1, peer 192.0.2.1
>   gate 192.168.0.1
>   Last update: Mon Apr 24 22:10:07 2023
>
> dut-vm# show ip nht
> 192.0.2.1
>  resolved via bgp
>  via 192.168.0.1, r2-eth0
>  Client list: bgp(fd 33)

Modify the display of BGP nexthop tracking to also dump
the interface used:

> dut-vm# show bgp nexthop
> [..]
> Current BGP nexthop cache:
>  192.0.2.1 valid [IGP metric 0], #paths 1, peer 192.0.2.1
>   gate 192.168.0.1, r2-eth0
>   Last update: Mon Apr 24 22:10:07 2023

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
12 months agoisisd: fix a memory leak in isis_spftree_clear()
Louis Scalbert [Thu, 27 Apr 2023 12:50:47 +0000 (14:50 +0200)]
isisd: fix a memory leak in isis_spftree_clear()

isis_spftree_clear() calls:
  - _isis_spftree_del() to partially delete a spftree instance
    without freeing spftree->route_table and
    spftree->route_table_backup.
  - then _isis_spftree_init() that allocates new spftree->route_table
    and spftree->route_table_backup.

As a consequence, the previous table instances are not referenced and
not freed.

Free the route tables before allocating new ones.

Fixes: 860b75b40e ("isisd: calculate flex-algo constraint spf")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoisisd, lib: clarify sizeof on flex-algo memory allocation
Louis Scalbert [Thu, 27 Apr 2023 09:52:03 +0000 (11:52 +0200)]
isisd, lib: clarify sizeof on flex-algo memory allocation

Use the struct instead of the pointer for flex-algo memory allocation.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoisisd: fix flex-algo data memory leak at algorithm removal
Louis Scalbert [Tue, 25 Apr 2023 11:08:21 +0000 (13:08 +0200)]
isisd: fix flex-algo data memory leak at algorithm removal

Fix a flex-algo data memory leak when a specific algorithm is removed.

Fixes: 7f198e063c ("isisd: add isis flex-algo base interface")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agoisisd, lib: fix flex-algo database memory leak at area destruction
Louis Scalbert [Mon, 24 Apr 2023 16:19:03 +0000 (18:19 +0200)]
isisd, lib: fix flex-algo database memory leak at area destruction

Free flex-algorithm database memory when an IS-IS area is destroyed.

Fixes: 735fb37db1 ("lib: add library for igp flexible-algorithm")
Fixes: 7f198e063c ("isisd: add isis flex-algo base interface")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agolib: dispatch flex_algo_delete()
Louis Scalbert [Thu, 27 Apr 2023 13:16:28 +0000 (15:16 +0200)]
lib: dispatch flex_algo_delete()

Dispatch flex_algo_delete() to prepare the next commit. Cosmetic change.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agolib: move flex_algo_delete() just after flex_algo_alloc()
Louis Scalbert [Thu, 27 Apr 2023 13:11:42 +0000 (15:11 +0200)]
lib: move flex_algo_delete() just after flex_algo_alloc()

Move flex_algo_delete() just after flex_algo_alloc(). No change on code.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agolib: clarify flex-algo mtype
Louis Scalbert [Thu, 27 Apr 2023 13:05:42 +0000 (15:05 +0200)]
lib: clarify flex-algo mtype

Clarify flex-algo MTYPE by creating a specific MTYPE definition to the
database of flex-algo information.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
12 months agopimd: Fix wrong setsockopt() call
anlan_cs [Wed, 26 Apr 2023 09:59:58 +0000 (17:59 +0800)]
pimd: Fix wrong setsockopt() call

`setsockopt()` should be only called once with `MRT_TABLE`
in "enable" case, otherwise it will fail.  In current code,
`mroute_socket` of "pim instance" with VRF can't be correctly
closed.

Skip it in the "disable" case to let `mroute_socket` safely
closed.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
12 months agotests: Do not try establishing a connection from r1 to r2
Donatas Abraitis [Wed, 26 Apr 2023 18:51:33 +0000 (21:51 +0300)]
tests: Do not try establishing a connection from r1 to r2

If r1 becomes the "server" (= local port 179), then it initiates the connection
after sending BGP Notification (BFD Down) and r2 resets the last error code.

Telling r1 do not connect to r2, fixes the issue.

Tested with `pytest -s -n 48` at least 20 times - no failures.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
12 months agoMerge pull request #13386 from donaldsharp/bgp_received_routes
Donatas Abraitis [Wed, 26 Apr 2023 08:07:00 +0000 (11:07 +0300)]
Merge pull request #13386 from donaldsharp/bgp_received_routes

bgpd: Fix `received-routes detail`

12 months agoMerge pull request #13368 from Keelan10/nhrpd-memory-leak
Donatas Abraitis [Wed, 26 Apr 2023 05:57:52 +0000 (08:57 +0300)]
Merge pull request #13368 from Keelan10/nhrpd-memory-leak

nhrpd: Fix nhrpd memory leak

12 months agobgpd: Fix `received-routes detail`
Donald Sharp [Tue, 25 Apr 2023 19:35:19 +0000 (15:35 -0400)]
bgpd: Fix `received-routes detail`

The command `show bgp ipv4 uni neigh A.B.C.D received-routes detail`
was not displaying anything.

Fix the code to display the received routes from the ones that
have been filtered.  In this case we need to fudge up a bgp_dest
and a bgp_path_info to make it work.

Old output:

janelle.pinkbelly.org# show bgp ipv4 uni neighbors 192.168.119.224 received-routes detail
BGP table version is 1711405, local router ID is 192.168.44.1, vrf id 0
Default local pref 100, local AS 64539

Total number of prefixes 3 (3 filtered)
janelle.pinkbelly.org#

New output:

janelle.pinkbelly.org# show bgp ipv4 uni neighbors 192.168.119.224 received-routes detail
BGP table version is 0, local router ID is 192.168.44.1, vrf id 0
Default local pref 100, local AS 64539
BGP routing table entry for 1.2.3.0/24, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291, (aggregated by 3291 192.168.122.1)
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, atomic-aggregate, rpki validation-state: not found
      Community: 55:66
      Last update: Fri Apr 14 08:46:48 2023
BGP routing table entry for 1.2.3.4/32, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, rpki validation-state: not found
      Community: 33:44
      Last update: Fri Apr 14 08:46:48 2023
BGP routing table entry for 1.2.3.5/32, version 0
Paths: (1 available, no best path)
  Not advertised to any peer
  3291
    192.168.119.224 (inaccessible, import-check enabled) from 192.168.119.224 (192.168.122.1)
      Origin IGP, metric 0, invalid, external, rpki validation-state: not found
      Community: 33:44
      Last update: Fri Apr 14 08:46:48 2023

Total number of prefixes 3 (3 filtered)
janelle.pinkbelly.org# show bgp ipv4 uni
No BGP prefixes displayed, 0 exist
janelle.pinkbelly.org#

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13374 from opensourcerouting/build-fix-rmap-yang
Mark Stapp [Tue, 25 Apr 2023 19:26:19 +0000 (15:26 -0400)]
Merge pull request #13374 from opensourcerouting/build-fix-rmap-yang

build: fix frr-if-rmap.yang model embedding

12 months agoripd: add non-zero check for RIPv1 reserved field,
zmw12306 [Tue, 25 Apr 2023 18:37:28 +0000 (14:37 -0400)]
ripd: add non-zero check for RIPv1 reserved field,

According to RFC2453 3.6, the tag of a RIP-1 entry should be zero
Signed-off-by: zmw12306 <zmw12306@gmail.com>
12 months agoMerge pull request #13246 from opensourcerouting/rip-bfd
Russ White [Tue, 25 Apr 2023 15:54:32 +0000 (11:54 -0400)]
Merge pull request #13246 from opensourcerouting/rip-bfd

ripd: support BFD integration

12 months agoMerge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list
Russ White [Tue, 25 Apr 2023 15:07:31 +0000 (11:07 -0400)]
Merge pull request #13326 from opensourcerouting/feature/rip_topotest_distribute_list

ripd: Create non default passive interface if defined so

12 months agoMerge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_co...
Russ White [Tue, 25 Apr 2023 15:06:23 +0000 (11:06 -0400)]
Merge pull request #13310 from opensourcerouting/feature/bgpd_node_target_extended_community

bgpd: Add Node Target Extended Communities support

12 months agotests: Run black on test_ospf_lan.py
Donald Sharp [Tue, 25 Apr 2023 11:54:07 +0000 (07:54 -0400)]
tests: Run black on test_ospf_lan.py

frrbot unhappy.
Let's bring a smile to it's life.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agotests: Increase the dead interval to be longer for neighbor testing
Donald Sharp [Mon, 24 Apr 2023 17:32:51 +0000 (13:32 -0400)]
tests: Increase the dead interval to be longer for neighbor testing

the ospf_basic_functionality/test_ospf_lan.py script is setting
up a lan env that will have 4 ospf routers on it and shutting/no
shutting interfaces with various priorities to see that ospf
is properly choosing roles.  I am consistently seeing the
ospf_basic_functionality/test_ospf_lan.py script failing
where it is saying a neighbor is not in the correct state.

Upon examination of the logs we are seeing this:

2023/04/24 09:16:42 OSPF: [M7Q4P-46WDR] vty[7]@(config)# interface r0-s1-eth0  <----- This is where we no shut the interface
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:47 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:53 OSPF: [QH9AB-Y4XMZ][EC 100663314] STARVATION: task ospf_ism_event (556af08a5b4c) ran for 6038ms (cpu time 0ms)
2023/04/24 09:16:53 OSPF: [HKQ2F-8D0MY][EC 100663315] Thread Starvation: {(thread *)0x556af19da020 arg=0x556af19c0dd0 timer  r=-5.086     ospf_ase_calculate_timer() &ospf->t_ase_calc from ospfd/ospf_ase.c:635} was scheduled to pop greater than 4s ago
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@> enable
2023/04/24 09:16:53 OSPF: [M7Q4P-46WDR] vty[18]@# show ip ospf neighbor all
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@# show ip ospf neighbor all json
2023/04/24 09:16:55 OSPF: [M7Q4P-46WDR] vty[7]@> enable

This test is setting the dead interval to 4 seconds, seeing a 6 second delay where the os has gone to town
(probably because of the high load on the system ) and not choosing the correct neighbor as the DR.

OSPF when coming up and after seeing the first neighbor, goes into a waiting period before
the DR is elected.  If the neighbor does send it's hello packets but they are not processed
before the wait timer pops because of the starvation event, then the wrong neighbor
will be elected DR.  Let's give this test a bit more time to decide who the
DR is in case everything goes a bit south.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
12 months agoMerge pull request #13375 from LabNConsulting/chopps/fix-style-issues
Donald Sharp [Tue, 25 Apr 2023 11:28:46 +0000 (07:28 -0400)]
Merge pull request #13375 from LabNConsulting/chopps/fix-style-issues

lib: fix style warns and get rid of "!" for success

12 months agoMerge pull request #13373 from LabNConsulting/chopps/fix-pytestconfig
Donald Sharp [Mon, 24 Apr 2023 22:02:49 +0000 (18:02 -0400)]
Merge pull request #13373 from LabNConsulting/chopps/fix-pytestconfig

fix missed passing pytestconfig arg.

12 months agolib: fix style warns and get rid of "!" for success
Christian Hopps [Mon, 24 Apr 2023 15:20:48 +0000 (11:20 -0400)]
lib: fix style warns and get rid of "!" for success

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agobuild: fix frr-if-rmap.yang model embedding
David Lamparter [Mon, 24 Apr 2023 15:00:55 +0000 (17:00 +0200)]
build: fix frr-if-rmap.yang model embedding

This was missed somewhere along the line, causing ripd to not start.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
12 months agoMerge pull request #13149 from pushpasis/mgmt_cleanup_zlog
Christian Hopps [Mon, 24 Apr 2023 15:00:08 +0000 (11:00 -0400)]
Merge pull request #13149 from pushpasis/mgmt_cleanup_zlog

mgmtd, lib: Cleanup zlog_err()

12 months agoMerge pull request #13330 from chiragshah6/fdev1
Donatas Abraitis [Mon, 24 Apr 2023 13:51:10 +0000 (16:51 +0300)]
Merge pull request #13330 from chiragshah6/fdev1

zebra: EVPN handle duplicate detected local mac delete event

12 months agotests: fix missed passing pytestconfig arg
Christian Hopps [Mon, 24 Apr 2023 13:22:42 +0000 (09:22 -0400)]
tests: fix missed passing pytestconfig arg

Remove the local ConfigOptionProxy and actually use the munet one.

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: import munet 0.13.2
Christian Hopps [Mon, 24 Apr 2023 13:47:23 +0000 (09:47 -0400)]
tests: import munet 0.13.2

fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13365 from LabNConsulting/chopps/add-perf-option
Donald Sharp [Mon, 24 Apr 2023 11:38:45 +0000 (07:38 -0400)]
Merge pull request #13365 from LabNConsulting/chopps/add-perf-option

Add ability to profile daemons in topotest with --perf

12 months agoMerge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native
Donatas Abraitis [Mon, 24 Apr 2023 10:50:36 +0000 (13:50 +0300)]
Merge pull request #13361 from LabNConsulting/chopps/munet-cfgopt-and-native

cfgopt in munet and native config support and example

12 months agonhrpd: Fix nhrpd memory leak
Keelan10 [Mon, 24 Apr 2023 07:00:20 +0000 (11:00 +0400)]
nhrpd: Fix nhrpd memory leak

Free NHRP peers associated with an interface when NHS is deleted on shutdown

Signed-off-by: Keelan Cannoo <keelan.cannoo@icloud.com>
12 months agodoc: document --perf and --perf-options, and a bit of cleanup
Christian Hopps [Mon, 24 Apr 2023 01:56:38 +0000 (21:56 -0400)]
doc: document --perf and --perf-options, and a bit of cleanup

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: add --perf and --perf-options for profiling daemons
Christian Hopps [Mon, 24 Apr 2023 01:53:44 +0000 (21:53 -0400)]
tests: add --perf and --perf-options for profiling daemons

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13350 from opensourcerouting/typesafe-fixes-20230421
Donald Sharp [Sun, 23 Apr 2023 19:06:59 +0000 (15:06 -0400)]
Merge pull request #13350 from opensourcerouting/typesafe-fixes-20230421

lib: typesafe shenanigans

12 months agotests: add an example of using munet native config
Christian Hopps [Sun, 23 Apr 2023 12:26:41 +0000 (08:26 -0400)]
tests: add an example of using munet native config

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: enable using munet native configs
Christian Hopps [Sun, 23 Apr 2023 12:25:51 +0000 (08:25 -0400)]
tests: enable using munet native configs

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: munet now supports cfgopt directly
Christian Hopps [Sun, 23 Apr 2023 13:17:35 +0000 (09:17 -0400)]
tests: munet now supports cfgopt directly

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agotests: import munet version 0.13.1
Christian Hopps [Sun, 23 Apr 2023 05:29:49 +0000 (01:29 -0400)]
tests: import munet version 0.13.1

- adds more generic config option handling than pytestconfig
- Change to search order for kinds.yaml

Signed-off-by: Christian Hopps <chopps@labn.net>
12 months agoMerge pull request #13358 from zmw12306/ignore_nonzero_flags
Donald Sharp [Sun, 23 Apr 2023 11:25:30 +0000 (07:25 -0400)]
Merge pull request #13358 from zmw12306/ignore_nonzero_flags

12 months agoMerge pull request #13360 from LabNConsulting/chopps/munet-fixes
Donald Sharp [Sun, 23 Apr 2023 11:18:07 +0000 (07:18 -0400)]
Merge pull request #13360 from LabNConsulting/chopps/munet-fixes