Commit Graph

32224 Commits

Author SHA1 Message Date
Donatas Abraitis
f21277a38a ripd: Do not overrun with more ECMP paths than Zebra supports
Let's say FRR is compiled with ECMP max 16, we enter `allow-ecmp 10`, but
Zebra supports only 4.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-05 23:11:16 +03:00
sri-mohan1
849d8f2bbd ldpd: changes for code maintainability
these changes are for improving the code maintainability and readability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2023-05-05 23:41:01 +05:30
Donald Sharp
d8be139972 zebra: Reduce creation and fix memory leak of frrscripting pointers
There are two issues being addressed:

a) The ZEBRA_ON_RIB_PROCESS_HOOK_CALL script point
was creating a fs pointer per dplane ctx in
rib_process_dplane_results().

b) The fs pointer was not being deleted and directly
leaked.

For (a) Move the creation of the fs to outside
the do while loop.

For (b) At function end ensure that the pointer
is actually deleted.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-05-05 12:24:02 -04:00
Louis Scalbert
586861a141 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>
2023-05-05 17:50:36 +02:00
Donatas Abraitis
4ead6555c9
Merge pull request #13436 from donaldsharp/ospf_json_mem_leak
ospfd: Fix memory leaks w/ `show ip ospf int X json` commands
2023-05-05 15:14:16 +03:00
Donald Sharp
d6d4962f38
Merge pull request #13428 from opensourcerouting/ripd-bfd-fixes
ripd: fix problemas
2023-05-05 08:04:57 -04:00
Donald Sharp
91c5393a71
Merge pull request #13435 from mjstapp/fix_pim_cpp_notice
pimd: replace CPP_NOTICE lines with TODO comments
2023-05-05 08:04:23 -04:00
Donald Sharp
9579b2f605
Merge pull request #13423 from LabNConsulting/chopps/coverity-string-fix
mgmtd: simplify commit id to just be a timeval string
2023-05-05 07:35:06 -04:00
Rajasekar Raja
795bef98db bgpd: Fixing the show bgp <vrf> <afi> <safi> detail command
Adding support to show cmds like  show bgp vrf all detail, show bgp
<afi> <safi> detail & show bgp <vrf> <afi> <safi> detail

Issue:3168406
Ticket:#3168406

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2023-05-05 00:01:21 -07:00
Naveen Guggarigoud
2c435e98ad tests: removing un used loopback interface from bgp admin dist.
Signed-off-by: Naveen Guggarigoud <nguggarigoud@vmware.com>
2023-05-05 05:20:40 +00:00
Christian Hopps
3701780a15 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>
2023-05-04 14:48:59 -04:00
Christian Hopps
d31d24c488 mgmtd: simplify commit id to just be a timeval string
Also fixes coverity warning

Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-04 14:47:55 -04:00
Christian Hopps
27797fec2c
Merge pull request #13357 from Jafaral/fix_ospf_prop
tests: clear the ospf neighbor to force a state change
2023-05-04 14:46:56 -04:00
Donald Sharp
74e21732db 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>
2023-05-04 12:56:13 -04:00
Mark Stapp
efa2a5f8ad 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>
2023-05-04 10:26:33 -04:00
Jafar Al-Gharaibeh
f92f88d361 tests: clear the ospf neighbor to force a state change
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2023-05-04 08:27:17 -05:00
Donatas Abraitis
75fce4645a ripd: Implement allow-ecmp X command
Allow setting an arbitrary number of paths to be installed instead of ALL.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 15:43:02 +03:00
Donatas Abraitis
9c011d7eaf doc: Add RIP allow-ecmp command
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:23:26 +03:00
Donatas Abraitis
66e0f6c456 tests: Check RIP allow-ecmp an arbitrary number of paths
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:23:26 +03:00
Donatas Abraitis
4972a6ee7f tests: Check if RIP allow-ecmp command can inject specified number of routes
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-04 09:02:42 +03:00
Renato Westphal
2da9c4c206 ripd: use correct memory type when freeing BFD profile
Fixes #13415.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-03 17:02:58 -03:00
Renato Westphal
bf384bbc90 ripd: fix null-pointer dereference
Fixes #13416.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-05-03 17:01:36 -03:00
Donald Sharp
abecbc3df1
Merge pull request #13425 from FRRouting/revert-12646-mpls_alloc_per_nh
Revert "MPLS allocation mode per next hop"
2023-05-03 07:35:37 -04:00
Donatas Abraitis
786e2b8bdb Revert "MPLS allocation mode per next hop"
Broken tests, let's revert now.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-05-03 13:52:46 +03:00
Mark Stapp
25664eae52
Merge pull request #13422 from donaldsharp/pim_thread_off_fix
pimd: Fix old commit that got in
2023-05-02 14:57:25 -04:00
Donald Sharp
42f5ab16ec 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>
2023-05-02 14:49:32 -04:00
Donald Sharp
f7a775a78e
Merge pull request #13020 from SaiGomathiN/2462808-3
pimd: PIM not sending register packets after changing from non DR to DR
2023-05-02 11:55:34 -04:00
Donatas Abraitis
99a1ab0b21
Merge pull request #12646 from pguibert6WIND/mpls_alloc_per_nh
MPLS allocation mode per next hop
2023-05-02 18:36:45 +03:00
Russ White
d0053da26b
Merge pull request #13376 from louis-6wind/fix-flex-algo-mem-leak
isisd, lib: fix flex-algo memory leak
2023-05-02 11:33:38 -04:00
Donatas Abraitis
da57946b0e
Merge pull request #13366 from zmw12306/rte_tag
ripd: add non-zero check for RIPv1 reserved field
2023-05-02 17:56:09 +03:00
Russ White
1998805bd5
Merge pull request #13403 from anlancs/fix/zebra-missing-vrf-flag
zebra: Fix missing VRF flag
2023-05-02 10:47:41 -04:00
Russ White
b9f0c8c8d0
Merge pull request #13404 from louis-6wind/fix-flex-algo-race-condition
isisd: fix a flex algo race condition and a minor fix
2023-05-02 10:42:39 -04:00
Russ White
9ab0661b89
Merge pull request #13235 from Orange-OpenSource/link-state
lib: Fix memory leaks in Link State library
2023-05-02 10:31:10 -04:00
Russ White
856e85e910
Merge pull request #13270 from pguibert6WIND/better_srv6_output_seg6local
zebra: display seg6local only when specified
2023-05-02 10:30:15 -04:00
Russ White
c12a40fee3
Merge pull request #13354 from zmw12306/parse_request_subtlv
babeld: add parse_request_subtlv into parse_packet
2023-05-02 10:28:20 -04:00
Russ White
ccf08bda1a
Merge pull request #13377 from donaldsharp/ospf_dead_interval
tests: Increase the dead interval to be longer for neighbor testing
2023-05-02 10:25:46 -04:00
Donald Sharp
cdfc536f76
Merge pull request #13389 from anlancs/fix/pimd-wrong-mrt-sockopt
pimd: Fix wrong setsockopt() call
2023-05-02 09:21:24 -04:00
Donald Sharp
fa8d4970d2
Merge pull request #13393 from opensourcerouting/fix/topotest_bgp_bfd_down_cease_notification
tests: Do not try establishing a connection from r1 to r2
2023-05-02 08:42:43 -04:00
Donald Sharp
0313343d0a
Merge pull request #13395 from LabNConsulting/chopps/mgmtd-debug-flags
mgmtd: fully implement debug flags for mgmtd and clients
2023-05-02 08:17:17 -04:00
Donatas Abraitis
bec4eeedc4
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
2023-05-01 22:07:03 +03:00
Donatas Abraitis
997aad2af7
Merge pull request #13408 from pguibert6WIND/flowspec_sanity
bgpd: add some flowspec sanity returns
2023-05-01 21:58:53 +03:00
Donatas Abraitis
cf37803455
Merge pull request #13409 from chiragshah6/fdev1
zebra:add df flag into evpn esi json output
2023-05-01 21:55:38 +03:00
Christian Hopps
cfa0facbf9 mgmtd: fully implement debug flags for mgmtd and clients
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-01 13:47:12 -04:00
Donald Sharp
4c5f1eeb60
Merge pull request #13406 from LabNConsulting/chopps/log-timestamp-buildopt
startup log timestamp precision build option
2023-05-01 09:51:46 -04:00
anlan_cs
41414503e4 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>
2023-05-01 20:21:37 +08:00
Christian Hopps
3e09791861 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>
2023-04-29 02:36:17 -04:00
Christian Hopps
6b7481aa8d lib: add build option to set startup log timestemp precision
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-29 02:36:06 -04:00
Sindhu Parvathi Gopinathan
2223b4d543 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>
2023-04-28 16:04:25 -07:00
Dmytro Shytyi
4eef588ac3 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>
2023-04-28 22:51:12 +02:00
Dmytro Shytyi
d7967830ea 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>
2023-04-28 22:51:12 +02:00