]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
2 years agobgpd: Reuse prep_for_rmap_apply() when applying route-map for show cmd
Donatas Abraitis [Tue, 6 Sep 2022 08:49:48 +0000 (11:49 +0300)]
bgpd: Reuse prep_for_rmap_apply() when applying route-map for show cmd

Include extra path attributes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Do not forget to unlock bgp_dest from update_advertise_vni_routes
Donatas Abraitis [Tue, 6 Sep 2022 08:49:08 +0000 (11:49 +0300)]
bgpd: Do not forget to unlock bgp_dest from update_advertise_vni_routes

If "unexpected" happens.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #11902 from SaiGomathiN/igmp-to-gm
Donatas Abraitis [Tue, 6 Sep 2022 05:40:43 +0000 (08:40 +0300)]
Merge pull request #11902 from SaiGomathiN/igmp-to-gm

pimd, pim6d: Changing IGMP to GM in debug macros

2 years agopimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to PIM_DEBUG_GM_PACKETS
Sai Gomathi N [Mon, 5 Sep 2022 05:45:33 +0000 (22:45 -0700)]
pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_PACKETS to PIM_DEBUG_GM_PACKETS

Changing the macros to common so that it can be used for pimv6 debugs as well
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTS
Sai Gomathi N [Fri, 2 Sep 2022 11:00:10 +0000 (04:00 -0700)]
pimd,pim6d: Modifying IGMP to GM in PIM_DEBUG_IGMP_EVENTS to PIM_DEBUG_GM_EVENTS

Changing the macros to common so that it can be used for pimv6 debugs as well
to be used for both IGMP and MLD debugs.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agoMerge pull request #11898 from sri-mohan1/sri-rip-dbg1
Donatas Abraitis [Sun, 4 Sep 2022 18:18:12 +0000 (21:18 +0300)]
Merge pull request #11898 from sri-mohan1/sri-rip-dbg1

ripd: changes for code maintainability

2 years agoMerge pull request #11897 from mobash-rasool/fixes2
Donatas Abraitis [Sun, 4 Sep 2022 18:16:59 +0000 (21:16 +0300)]
Merge pull request #11897 from mobash-rasool/fixes2

pimd: Removal of unused function pim_neighbor_find_prefix

2 years agoripd: changes for code maintainability
sri-mohan1 [Fri, 2 Sep 2022 18:29:56 +0000 (23:59 +0530)]
ripd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agopimd: Removal of unused function pim_neighbor_find_prefix
Mobashshera Rasool [Fri, 2 Sep 2022 16:50:28 +0000 (09:50 -0700)]
pimd: Removal of unused function pim_neighbor_find_prefix

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11884 from mjstapp/fix_cancel_ptrs
Donatas Abraitis [Fri, 2 Sep 2022 10:49:10 +0000 (13:49 +0300)]
Merge pull request #11884 from mjstapp/fix_cancel_ptrs

lib: ensure locals are inited to NULL

2 years agoMerge pull request #11888 from anlancs/fix/l2vni-vid-change
Donatas Abraitis [Fri, 2 Sep 2022 10:21:44 +0000 (13:21 +0300)]
Merge pull request #11888 from anlancs/fix/l2vni-vid-change

zebra: fix missing tenant vrf change notification

2 years agoMerge pull request #11894 from sri-mohan1/sri-bgp-dbg1
Donatas Abraitis [Fri, 2 Sep 2022 10:21:34 +0000 (13:21 +0300)]
Merge pull request #11894 from sri-mohan1/sri-bgp-dbg1

bgpd: changes for code maintainability

2 years agoMerge pull request #11893 from kraj/master
Jafar Al-Gharaibeh [Thu, 1 Sep 2022 22:09:01 +0000 (17:09 -0500)]
Merge pull request #11893 from kraj/master

configure: Check for readline() function instead of main

2 years agobgpd: changes for code maintainability
sri-mohan1 [Thu, 1 Sep 2022 18:55:16 +0000 (00:25 +0530)]
bgpd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoconfigure: Check for readline() function instead of main
Khem Raj [Thu, 1 Sep 2022 17:39:23 +0000 (10:39 -0700)]
configure: Check for readline() function instead of main

main is not a function found in libreadline, its better to check for a
function thats provided by it.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
2 years agozebra: fix missing tenant vrf change notification
anlan_cs [Wed, 31 Aug 2022 14:24:19 +0000 (10:24 -0400)]
zebra: fix missing tenant vrf change notification

zebra can change l2vni's tenant vrf with new `vid`, and then notify bgpd
to change also. But this notification is wrongly missed, so bgpd knows
nothing about it. It affects evpn routes, which are related to tenant vrf.
Need to notify bgpd of the `vid` change.

Changes l2vni 100 of vxlan's `vid` so as to change its svi interface from
default to vrf1, then check bgp's vni status.

Before: (Ignored irrelevent columns)
```
host#show bgp l2vpn evpn vni
  VNI      Type RD                    Tenant VRF
* 100      L2   66.66.66.66:2         default <- No change
```

After:(Ignored irrelevent columns)
```
host#show bgp l2vpn evpn vni
  VNI      Type RD                   Tenant VRF
* 100      L2   66.66.66.66:2        vrf1 <- Updated
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agolib: ensure locals are inited to NULL
Mark Stapp [Wed, 31 Aug 2022 15:47:39 +0000 (11:47 -0400)]
lib: ensure locals are inited to NULL

A couple of pointers in do_thread_cancel() we only inited at
the start of the function; make sure they're inited during
each iteration of the loop.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #11879 from mobash-rasool/fixes2
Donald Sharp [Tue, 30 Aug 2022 19:09:36 +0000 (15:09 -0400)]
Merge pull request #11879 from mobash-rasool/fixes2

pim6d: Fix the Code for MLD in the show pim state command

2 years agoMerge pull request #11878 from opensourcerouting/fix/some_nits
Donald Sharp [Tue, 30 Aug 2022 19:06:29 +0000 (15:06 -0400)]
Merge pull request #11878 from opensourcerouting/fix/some_nits

bgpd: A couple of minor findings

2 years agoMerge pull request #11833 from opensourcerouting/feature/bgp_neighbor_soo
Russ White [Tue, 30 Aug 2022 15:17:53 +0000 (11:17 -0400)]
Merge pull request #11833 from opensourcerouting/feature/bgp_neighbor_soo

bgpd: Add `neighbor soo` command

2 years agoMerge pull request #11852 from gpnaveen/bgp_admin_dist
Russ White [Tue, 30 Aug 2022 15:13:30 +0000 (11:13 -0400)]
Merge pull request #11852 from gpnaveen/bgp_admin_dist

tests: adding bgp admin distance topotests.

2 years agoMerge pull request #11866 from anlancs/fix/evpn-l2vni
Donatas Abraitis [Tue, 30 Aug 2022 15:13:02 +0000 (18:13 +0300)]
Merge pull request #11866 from anlancs/fix/evpn-l2vni

zebra: fix missing vni transition

2 years agoMerge pull request #11870 from rgirada/ospf_gr_crash
Rafael Zalamena [Tue, 30 Aug 2022 13:10:15 +0000 (10:10 -0300)]
Merge pull request #11870 from rgirada/ospf_gr_crash

ospfd: crash when router acts as GR helper upon a topo change

2 years agobgpd: Cleanup memory for missing hashes
Donatas Abraitis [Tue, 30 Aug 2022 10:46:26 +0000 (13:46 +0300)]
bgpd: Cleanup memory for missing hashes

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Drop unused memory types
Donatas Abraitis [Tue, 30 Aug 2022 10:39:10 +0000 (13:39 +0300)]
bgpd: Drop unused memory types

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agopim6d: Fix the Code for MLD in the show pim state command
Mobashshera Rasool [Tue, 30 Aug 2022 10:02:25 +0000 (03:02 -0700)]
pim6d: Fix the Code for MLD in the show pim state command

show ip pim state should show IGMP Report while
show ipv6 pim state should show MLD Report.

Output After Fix:
frr# do sh ip pim state
Codes: J -> Pim Join, I -> IGMP Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted
Active Source           Group            RPT  IIF               OIL

frr# do sh ipv6 pim state
Codes: J -> Pim Join, I -> MLD Report, S -> Source, * -> Inherited from (*,G), V -> VxLAN, M -> Muted
Active Source           Group            RPT  IIF               OIL

frr#

Issue: #11249

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #11877 from sri-mohan1/sri-ldp-dbg1
Donatas Abraitis [Tue, 30 Aug 2022 09:55:27 +0000 (12:55 +0300)]
Merge pull request #11877 from sri-mohan1/sri-ldp-dbg1

ldpd: changes for code maintainability

2 years agobgpd: Fix test for matching UN prefix and the peer
Donatas Abraitis [Tue, 30 Aug 2022 09:06:19 +0000 (12:06 +0300)]
bgpd: Fix test for matching UN prefix and the peer

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Break immediatelly and print vty_out instead of double checking for JSON
Donatas Abraitis [Tue, 30 Aug 2022 08:46:00 +0000 (11:46 +0300)]
bgpd: Break immediatelly and print vty_out instead of double checking for JSON

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Remove redundant test against ifp for DEBUG messages
Donatas Abraitis [Tue, 30 Aug 2022 08:35:05 +0000 (11:35 +0300)]
bgpd: Remove redundant test against ifp for DEBUG messages

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoospfd: crash when router acts as GR helper upon a topo change
rgirada [Mon, 29 Aug 2022 10:51:39 +0000 (03:51 -0700)]
ospfd: crash when router acts as GR helper upon a topo change

Description:
ospf process is crashing when  the current router acts
as GR helper and it received a new lsa.

Here, ospf_lsa_different() is being called without checking
'old' pointer. It is asserted in ospf_lsa_different() api
if the 'old' pointer is NULL.

corrected this by validaing old pointer before calling
ospf_lsa_different() api.

back tarce:
Program terminated with signal SIGABRT, Aborted.
0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
[Current thread is 1 (Thread 0x6b84348827c0 (LWP 3155))]
0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
1  0x00006b8433aa4801 in __GI_abort () at abort.c:79
2  0x00006b8433a9439a in __assert_fail_base (fmt=0x6b8433c1b7d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:92
3  0x00006b8433a94412 in __GI___assert_fail (assertion=assertion@entry=0x162ffc0630bc "l1", file=file@entry=0x162ffc062ff7 "ospfd/ospf_lsa.c", line=line@entry=3520, function=function@entry=0x162ffc0646f0 <__PRETTY_FUNCTION__.18732> "ospf_lsa_different") at assert.c:101
4  0x0000162ffc008c25 in ospf_lsa_different (l1=l1@entry=0x0, l2=l2@entry=0x162ffe535c60, ignore_rcvd_flag=ignore_rcvd_flag@entry=true) at ospfd/ospf_lsa.c:3520
5  0x0000162ffc00a8e8 in ospf_lsa_install (ospf=ospf@entry=0x162ffe513650, oi=oi@entry=0x162ffe531c30, lsa=lsa@entry=0x162ffe535c60) at ospfd/ospf_lsa.c:2892
6  0x0000162ffc059d16 in ospf_flood (ospf=0x162ffe513650, nbr=nbr@entry=0x162ffe52cc90, current=current@entry=0x0, new=new@entry=0x162ffe535c60) at ospfd/ospf_flood.c:429
7  0x0000162ffc01838f in ospf_ls_upd (size=<optimized out>, oi=0x162ffe531c30, s=<optimized out>, ospfh=<optimized out>, iph=<optimized out>, ospf=<optimized out>) at ospfd/ospf_packet.c:2162
8  ospf_read_helper (ospf=<optimized out>) at ospfd/ospf_packet.c:3241
9  ospf_read (thread=<optimized out>) at ospfd/ospf_packet.c:3272
10 0x00006b843450139c in thread_call (thread=thread@entry=0x7780f42c7480) at lib/thread.c:1692
11 0x00006b84344cfb18 in frr_run (master=0x162ffe34d130) at lib/libfrr.c:1068

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agoldpd: changes for code maintainability
sri-mohan1 [Mon, 29 Aug 2022 17:52:16 +0000 (23:22 +0530)]
ldpd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoMerge pull request #11874 from sri-mohan1/sri-isis-dbg1
Donatas Abraitis [Mon, 29 Aug 2022 18:30:17 +0000 (21:30 +0300)]
Merge pull request #11874 from sri-mohan1/sri-isis-dbg1

isisd: changes for code maintainability

2 years agoMerge pull request #11871 from AbhishekNR/mem_free
Donatas Abraitis [Mon, 29 Aug 2022 18:25:00 +0000 (21:25 +0300)]
Merge pull request #11871 from AbhishekNR/mem_free

pimd, pim6d: deleting the memory malloced for json.

2 years agopimd, pim6d: deleting the memory malloced for json.
Abhishek N R [Mon, 29 Aug 2022 11:50:26 +0000 (04:50 -0700)]
pimd, pim6d: deleting the memory malloced for json.

Problem Statement:
=================
2022-08-18 04:57:32,376 - ERROR: Found memory leak in daemon pimd
2022-08-18 04:57:32,377 - ERROR: ==12100== 18,978 (144 direct, 18,834 indirect) bytes in 2 blocks are definitely lost in loss record 45 of 45
2022-08-18 04:57:32,377 - ERROR: ==12100==    at 0x4C31FAC: calloc (vg_replace_malloc.c:762)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x532F51F: json_object_new_object (in /lib/x86_64-linux-gnu/libjson-c.so.3.0.1)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x128B5C: pim_show_interfaces (pim_cmd_common.c:3395)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x15A86B: show_ip_pim_interface_magic (pim_cmd.c:3127)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x15A86B: show_ip_pim_interface (pim_cmd_clippy.c:324)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E672B2: cmd_execute_command_real.isra.2 (command.c:1005)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E696FE: cmd_execute_command (command.c:1064)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E698F1: cmd_execute (command.c:1227)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBC814: vty_command (vty.c:530)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBC9EF: vty_execute (vty.c:1295)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EBF1F7: vtysh_read (vty.c:2142)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4EB739B: thread_call (thread.c:1692)
2022-08-18 04:57:32,377 - ERROR: ==12100==    by 0x4E85B17: frr_run (libfrr.c:1068)
2022-08-18 04:57:32,377 - ERROR: ==12100==

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agoisisd: changes for code maintainability
sri-mohan1 [Mon, 29 Aug 2022 13:35:24 +0000 (19:05 +0530)]
isisd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoMerge pull request #11855 from cscarpitta/fix-srv6-memleaks
Donatas Abraitis [Mon, 29 Aug 2022 11:35:24 +0000 (14:35 +0300)]
Merge pull request #11855 from cscarpitta/fix-srv6-memleaks

*: Fix several memory leaks in SRv6 implementation

2 years agoMerge pull request #11869 from sri-mohan1/sri-isis-dbg1
Donatas Abraitis [Mon, 29 Aug 2022 10:43:11 +0000 (13:43 +0300)]
Merge pull request #11869 from sri-mohan1/sri-isis-dbg1

isisd: changes for code maintainability

2 years agoMerge pull request #11581 from AbhishekNR/mld_hardcode_value
Donatas Abraitis [Mon, 29 Aug 2022 10:27:28 +0000 (13:27 +0300)]
Merge pull request #11581 from AbhishekNR/mld_hardcode_value

pim6d: Completing mld config commands.

2 years agoMerge pull request #11857 from mobash-rasool/fixes2
Donatas Abraitis [Mon, 29 Aug 2022 07:14:34 +0000 (10:14 +0300)]
Merge pull request #11857 from mobash-rasool/fixes2

pim6d: mroute stuck in register state, multicast traffic getting drops

2 years agoisisd: changes for code maintainability
sri-mohan1 [Mon, 29 Aug 2022 06:53:46 +0000 (12:23 +0530)]
isisd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agodoc: Changed uppercase MLD to lowercase in ipv6 MLD last-member-query-interval (1...
Abhishek N R [Mon, 29 Aug 2022 06:35:03 +0000 (23:35 -0700)]
doc: Changed uppercase MLD to lowercase in ipv6 MLD last-member-query-interval (1-65535)

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agotests: adding bgp admin distance topotests.
nguggarigoud [Tue, 23 Aug 2022 07:35:11 +0000 (00:35 -0700)]
tests: adding bgp admin distance topotests.

This has bgp admin topotest automation suit.

Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
2 years agopim6d: Completing "ipv6 mld last-member-query-interval" command
Abhishek N R [Mon, 11 Jul 2022 17:09:39 +0000 (10:09 -0700)]
pim6d: Completing "ipv6 mld last-member-query-interval" command

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Completing "ipv6 mld last-member-query-count" command.
Abhishek N R [Mon, 11 Jul 2022 15:51:52 +0000 (08:51 -0700)]
pim6d: Completing "ipv6 mld last-member-query-count" command.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agopim6d: Completing "ipv6 mld query-max-response-time" command.
Abhishek N R [Mon, 11 Jul 2022 08:33:07 +0000 (01:33 -0700)]
pim6d: Completing "ipv6 mld query-max-response-time" command.

Signed-off-by: Abhishek N R <abnr@vmware.com>
2 years agoMerge pull request #11867 from sri-mohan1/sri-ospf-dbg1
mobash-rasool [Mon, 29 Aug 2022 06:20:54 +0000 (11:50 +0530)]
Merge pull request #11867 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agoospfd: changes for code maintainability
sri-mohan1 [Fri, 26 Aug 2022 17:22:36 +0000 (22:52 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agozebra: fix missing vni transition
anlan_cs [Fri, 26 Aug 2022 10:53:03 +0000 (06:53 -0400)]
zebra: fix missing vni transition

`show evpn vni detail` doesn't reflect any change in vni transition.
Need to add processing in command of `[no] vni (1-16777215)`.

With the config:
```
!
vni 66
!
vrf vrf1
 vni 88
 exit-vrf
!
```

Before:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: <- Empty
```

After:
```
(config-vrf)# no vni 88
(config-vrf)# do show evpn vni detail
VNI: 66
  Type: L3
  Tenant VRF: default
  L2 VNIs: 88 <-
```

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoMerge pull request #11863 from sri-mohan1/sri-ospf-dbg1
Donald Sharp [Fri, 26 Aug 2022 14:50:21 +0000 (10:50 -0400)]
Merge pull request #11863 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agoMerge pull request #11718 from SaiGomathiN/mldgroups
Donatas Abraitis [Fri, 26 Aug 2022 12:19:32 +0000 (15:19 +0300)]
Merge pull request #11718 from SaiGomathiN/mldgroups

pim6d: Implementing "show ipv6 mld groups" CLI

2 years agoMerge pull request #11844 from SaiGomathiN/ttable-1
Donatas Abraitis [Fri, 26 Aug 2022 08:48:18 +0000 (11:48 +0300)]
Merge pull request #11844 from SaiGomathiN/ttable-1

pimd, pim6d: Using ttable for displaying show CLIs

2 years agodoc: Updated the doc for show ipv6 mld groups command
Sai Gomathi N [Tue, 2 Aug 2022 11:09:28 +0000 (04:09 -0700)]
doc: Updated the doc for show ipv6 mld groups command

show ipv6 mld [vrf NAME] groups [json] displays MLD group information.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopim6d: Implementing "show mld groups" CLI
Sai Gomathi N [Tue, 2 Aug 2022 11:08:11 +0000 (04:08 -0700)]
pim6d: Implementing "show mld groups" CLI

To Display MLD Group information

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopimd: Modifying member of pim_instance to accomodate IPv6 changes
Sai Gomathi N [Tue, 2 Aug 2022 10:55:09 +0000 (03:55 -0700)]
pimd: Modifying member of pim_instance to accomodate IPv6 changes

Modifying igmp_group_count of struct pim_instance
to gm_group_count which is to be used for both IGMP and MLD.

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agoospfd: changes for code maintainability
sri-mohan1 [Fri, 26 Aug 2022 07:24:57 +0000 (12:54 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoMerge pull request #11854 from donaldsharp/memory_walk_in_gdb
Donatas Abraitis [Fri, 26 Aug 2022 07:20:58 +0000 (10:20 +0300)]
Merge pull request #11854 from donaldsharp/memory_walk_in_gdb

gdb: Add a macro to walk memory allocations

2 years agoMerge pull request #11862 from sri-mohan1/sri-ospf-dbg1
mobash-rasool [Fri, 26 Aug 2022 06:38:53 +0000 (12:08 +0530)]
Merge pull request #11862 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agoospfd: changes for code maintainability
sri-mohan1 [Thu, 25 Aug 2022 18:14:50 +0000 (23:44 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoMerge pull request #11860 from opensourcerouting/fix/evpn_cli_json
Donald Sharp [Thu, 25 Aug 2022 17:20:19 +0000 (13:20 -0400)]
Merge pull request #11860 from opensourcerouting/fix/evpn_cli_json

bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

2 years agoMerge pull request #11858 from sri-mohan1/sri-ospf-dbg1
Donald Sharp [Thu, 25 Aug 2022 13:25:10 +0000 (09:25 -0400)]
Merge pull request #11858 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agoMerge pull request #11859 from liwg06/master.fix.extra.semicolon
Mark Stapp [Thu, 25 Aug 2022 12:53:36 +0000 (08:53 -0400)]
Merge pull request #11859 from liwg06/master.fix.extra.semicolon

lib: Fix extra semicolon after if

2 years agobgpd: Drop bnc_str() function
Donatas Abraitis [Thu, 25 Aug 2022 10:53:30 +0000 (13:53 +0300)]
bgpd: Drop bnc_str() function

Reuse %pFX -> prefix2str()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Convert prefix2str to %pFX
Donatas Abraitis [Thu, 25 Aug 2022 10:46:58 +0000 (13:46 +0300)]
bgpd: Convert prefix2str to %pFX

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Do not print new line for EVPN CLI outputs if it's a JSON
Donatas Abraitis [Thu, 25 Aug 2022 10:15:27 +0000 (13:15 +0300)]
bgpd: Do not print new line for EVPN CLI outputs if it's a JSON

Before:

```
$ vtysh -c 'show bgp l2vpn evpn route detail json'
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
<<<<<<<<<<<<<<<<<<<< empty line
{
...
"numPrefix":4,
"numPaths":4 <<<<< four paths = four empty lines
}
```

Contain as much "empty lines" before the JSON string as the number
of paths displayed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agolib: Fix extra semicolon after if
Weiguo Li [Thu, 25 Aug 2022 09:51:46 +0000 (17:51 +0800)]
lib: Fix extra semicolon after if

Signed-off-by: Weiguo Li <liwg06@foxmail.com>
2 years agoospfd: changes for code maintainability
sri-mohan1 [Wed, 24 Aug 2022 17:56:16 +0000 (23:26 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agopimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI
Sai Gomathi N [Mon, 22 Aug 2022 05:58:42 +0000 (22:58 -0700)]
pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI
Sai Gomathi N [Mon, 22 Aug 2022 05:35:04 +0000 (22:35 -0700)]
pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agoMerge pull request #11829 from donaldsharp/time_32_bits
Jafar Al-Gharaibeh [Wed, 24 Aug 2022 16:25:16 +0000 (11:25 -0500)]
Merge pull request #11829 from donaldsharp/time_32_bits

Time 32 bits

2 years agoMerge pull request #11856 from opensourcerouting/fix/revert_clist_internet
Mark Stapp [Wed, 24 Aug 2022 13:32:19 +0000 (09:32 -0400)]
Merge pull request #11856 from opensourcerouting/fix/revert_clist_internet

bgpd: Revert community-list INTERNET stuff

2 years agoripd: Use a sequence number instead of time
Donald Sharp [Wed, 17 Aug 2022 23:05:33 +0000 (19:05 -0400)]
ripd: Use a sequence number instead of time

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobabeld: Remove return value for gettime()
Donald Sharp [Wed, 17 Aug 2022 23:01:30 +0000 (19:01 -0400)]
babeld: Remove return value for gettime()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Convert time to uint64_t for zclient data structures
Donald Sharp [Wed, 17 Aug 2022 22:58:50 +0000 (18:58 -0400)]
zebra: Convert time to uint64_t for zclient data structures

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopimd: Intentionally downcast to a uint32_t value
Donald Sharp [Wed, 17 Aug 2022 22:43:09 +0000 (18:43 -0400)]
pimd: Intentionally downcast to a uint32_t value

When calling time(NULL), FRR is intentionally throwing
away the upper 32 bits of value returned.  Let's explicitly
call it out so that coverity understands this is intentional
and ok.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Replace rfapi_time() with monotime()
Donald Sharp [Wed, 17 Aug 2022 22:32:14 +0000 (18:32 -0400)]
bgpd: Replace rfapi_time() with monotime()

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: Convert from bgp_clock() to monotime()
Donald Sharp [Wed, 17 Aug 2022 22:27:54 +0000 (18:27 -0400)]
bgpd: Convert from bgp_clock() to monotime()

Let's convert to our actual library call instead
of using yet another abstraction that makes it fun
for people to switch daemons.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agosharpd: Fix memory leaks related to SRv6 nexthops
Carmine Scarpitta [Tue, 23 Aug 2022 22:53:19 +0000 (00:53 +0200)]
sharpd: Fix memory leaks related to SRv6 nexthops

Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks`
gives several memory leak errors. This is due to the way SRv6 routes
(seg6 and seg6local routes) are handled: when the user executes the CLI
command `sharp install seg6-routes` or `sharp install seg6local-routes`
to create a seg6 or seg6local route, sharpd calls
`nexthop_add_srv6_seg6` or `nexthop_add_srv6_seg6local` to create an
SRv6 nexthop. A pointer to the SRv6 nexthop is stored in the global data
structure `sg.r.nhop`. If you call `sharp install routes`,
`sharp install seg6-routes` or `sharp install seg6local-routes` to create
more routes, `sg.r.nhop` is set to zero and the
pointer to the SRv6 nexthop contained in `sg.r.nhop` is definitely lost
and the allocated memory is never freed.

This patch adds calls to `nexthop_del_srv6_seg6()` and
`nexthop_del_srv6_seg6local()` to free the memory allocated for the SRv6
nexthop before clearing the `sg.r.nhop` data structure.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agosharpd: Fix memory leak in release-locator-chunk
Carmine Scarpitta [Tue, 23 Aug 2022 22:35:43 +0000 (00:35 +0200)]
sharpd: Fix memory leak in release-locator-chunk

Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks`
gives several memory leak errors. This is due to the way SRv6 chunks are
released: when the user executes the CLI command
`sharp srv6-manager release-locator-chunk` to release the chunks of an
SRv6 locator, the `list_delete()` function is called to delete the
chunks list (`loc->chunks`), but the memory allocated for the chunks is
not freed.

This patch defines a new callback `sharp_srv6_locator_chunk_free()`.
This callback takes care of freeing the memory allocated for a given
chunk. When `list_delete()` is called to remove the chunk list
`loc->chunks`, it automatically calls `sharp_srv6_locator_chunk_free()`
on each element of the list to free the allocated memory before
deleting the list.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agosharpd: Fix memory leak in release-locator-chunk
Carmine Scarpitta [Tue, 23 Aug 2022 22:25:17 +0000 (00:25 +0200)]
sharpd: Fix memory leak in release-locator-chunk

Running the `zebra_seg6local_route` topotest with `--valgrind-memleaks`
gives several memory leak errors. This is due to the way SRv6 chunks are
released: when the user executes the CLI command
`sharp srv6-manager release-locator-chunk` to release the chunks of an
SRv6 locator, all the chunks are removed from the list `loc->chunks`.
Also, the locator is removed from the SRv6 locators list
`sg.srv6_locators`, but the memory allocated for the locator is not
freed.

This patch adds a call to `XFREE()` to properly free the allocated
memory when all the chunks of an SRv6 locator are removed and the
locator is removed as well.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: Fix memory leak in SRv6 locator delete
Carmine Scarpitta [Tue, 23 Aug 2022 22:13:25 +0000 (00:13 +0200)]
bgpd: Fix memory leak in SRv6 locator delete

Running `bgp_srv6l3vpn_to_bgp_vrf` and `bgp_srv6l3vpn_to_bgp_vrf2`
topotests with `--valgrind-memleaks` gives several memory leak errors.
This is due to the way SRv6 locators are removed/unset in bgpd: when
an SRv6 locator is deleted or unset, the memory allocated for the
locator prefix (`tovpn_sid_locator`) is not freed.

This patch adds a `for` loop that iterates over the list of BGP
instances. For each BGP instance using the SRv6 locator to be
removed/unset, we use `XFREE()` to properly free the memory allocated
for `tovpn_sid_locator` after the SRv6 locator is removed or unset.

The memory allocated for `tovpn_sid_locator` cannot be freed before
calling `vpn_leak_postchange_all()`. This is because
after deleting an SRv6 locator, we call `vpn_leak_postchange_all()`
to handle the SRv6 locator deletion and send a BGP Prefix SID withdraw
message. `tovpn_sid_locator` is required to properly build the BGP
Prefix SID withdraw message. After calling `vpn_leak_postchange_all()`
we can safely remove the `tovpn_sid_locator` and free the allocated
memory.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agogdb: Add a macro to walk memory allocations
Donald Sharp [Tue, 23 Aug 2022 20:31:02 +0000 (16:31 -0400)]
gdb: Add a macro to walk memory allocations

Add a macro to walk all memory allocations in a core file.

load the file in gdb:
source /path/to/frr/gdb/lib.txt
mg_walk mg_first
(gdb) mq_walk mg_first
showing active allocations in memory group libfrr
memstats: BFD info:0
memstats: Buffer:5
memstats: Buffer data:0
memstats: Host config:6
memstats: Completion item:0
memstats: Command Tokens:2585
memstats: Command Token Text:1951
memstats: Command Token Help:1951
memstats: Command Argument:0
memstats: Command Argument Name:575
memstats: Command Match Stack:0
memstats: Lexer token (temporary):0
memstats: Path Computation Algorithms:0
memstats: Distribute ctx:0
memstats: Distribute list:0
memstats: Dist-list ifname:0
memstats: Dist-list name:0
memstats: error information:0
memstats: Access List:0
memstats: Access List Str:0
memstats: Access Filter:0
memstats: RCU thread:0
<snip>

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #11848 from rgirada/ospf_gr_nbr
Donatas Abraitis [Wed, 24 Aug 2022 09:39:13 +0000 (12:39 +0300)]
Merge pull request #11848 from rgirada/ospf_gr_nbr

ospfd: Adding per neighbour json details to GR helper detail command

2 years agobgpd: Fix memory leak when an SRv6 SID is removed
Carmine Scarpitta [Tue, 23 Aug 2022 22:02:22 +0000 (00:02 +0200)]
bgpd: Fix memory leak when an SRv6 SID is removed

Running `bgp_srv6l3vpn_to_bgp_vrf` and `bgp_srv6l3vpn_to_bgp_vrf2`
topotests with `--valgrind-memleaks` gives several memory leak errors.
This is due to the way SRv6 SIDs are removed in bgpd: when
an SRv6 locator is deleted/unset, all the SIDs allocated from that
locator are removed from the SRv6 functions list
(`bgp->srv6_functions`),but the memory allocated for the SIDs is not
freed.

This patch adds a call to `XFREE()` to properly free the allocated
memory when an SRv6 SID is removed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: Fix memory leak in SRv6 locator delete/unset
Carmine Scarpitta [Tue, 23 Aug 2022 21:55:05 +0000 (23:55 +0200)]
bgpd: Fix memory leak in SRv6 locator delete/unset

Running `bgp_srv6l3vpn_to_bgp_vrf` and `bgp_srv6l3vpn_to_bgp_vrf2`
topotests with `--valgrind-memleaks` gives several memory leak errors.
This is due to the way SRv6 locators are deleted/unset in bgpd: when
an SRv6 locator is deleted/unset, all the chunks of the locator are
removed from the SRv6 locator chunks list (`bgp->srv6_locator_chunks`).
However, the memory allocated for the chunks is not freed.

This patch adds a call to the `srv6_locator_chunk_free()` function to
properly free the allocated memory when an SRv6 locator is removed or
unset.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agolib: Fix memory leak in `zclient_send_localsid()`
Carmine Scarpitta [Tue, 23 Aug 2022 21:27:47 +0000 (23:27 +0200)]
lib: Fix memory leak in `zclient_send_localsid()`

Running `bgp_srv6l3vpn_to_bgp_vrf` and `bgp_srv6l3vpn_to_bgp_vrf2`
topotests with `--valgrind-memleaks` gives several memory leak errors.
This is due to the way FRR daemons pass local SIDs to zebra: to send a
local SID to zebra, FRR daemons call the `zclient_send_localsid()`
function.

The `zclient_send_localsid()` function performs the following sequence
of operations:
* create a temporary `struct nexthop`;
* call `nexthop_add_srv6_seg6local()` to fill the `struct nexthop` with
the proper local SID information;
* create a `struct zapi_route` and call `zapi_nexthop_from_nexthop()` to
copy the information from the `struct nexthop` to the
`struct zapi_route`;
* send the `struct zapi_route` to zebra through the ZAPI.

The `nexthop_add_srv6_seg6local()` function uses `XCALLOC()` to allocate
memory for the SRv6 nexthop. This memory is never freed.

Creating a temporary `struct nexthop` is unnecessary, as the local SID
information can be pushed directly to the `struct zapi_route`. This
patch simplifies the implementation of `zclient_send_localsid()` by
avoiding using the temporary `struct nexthop`. This eliminates the need
to use `nexthop_add_srv6_seg6local()` to fill the `struct nexthop` and
consequently fixes the memory leak.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra: Fix memory leak in SRv6 locator delete
Carmine Scarpitta [Tue, 23 Aug 2022 20:40:47 +0000 (22:40 +0200)]
zebra: Fix memory leak in SRv6 locator delete

Running `srv6_locator` topotest with `--valgrind-memleaks` gives several
memory leak errors. This is due to the way SRv6 locators are deleted:
when an SRv6 locator is deleted, it is removed from the SRv6 locators
list (`srv6->locators`), but the memory allocated for the SRv6 locator
is not freed.

This patch adds a call to the `srv6_locator_free()` function to properly
free the allocated memory when an SRv6 locator is removed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agoMerge pull request #11853 from sri-mohan1/sri-ospf-dbg1
Donatas Abraitis [Wed, 24 Aug 2022 06:19:51 +0000 (09:19 +0300)]
Merge pull request #11853 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agodoc: Define `internet` BGP community
Donatas Abraitis [Wed, 24 Aug 2022 05:59:25 +0000 (08:59 +0300)]
doc: Define `internet` BGP community

Overall, rfc1997 states:

The community attribute values ranging from 0x0000000 through
   0x0000FFFF and 0xFFFF0000 through 0xFFFFFFFF are hereby reserved.

But we have a special handling here, like Cisco IOS XR.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoRevert "bgpd: Drop `internet` community check from community_list_match()"
Donatas Abraitis [Wed, 24 Aug 2022 05:46:56 +0000 (08:46 +0300)]
Revert "bgpd: Drop `internet` community check from community_list_match()"

Seems that, `internet` community is used to match ANY community.

This reverts commit e605d0cfae6a3fc9b65058ec85b55d7d0bd5cc22.

2 years agoRevert "tests: Check if BGP community-list filtering works correctly"
Donatas Abraitis [Wed, 24 Aug 2022 05:46:47 +0000 (08:46 +0300)]
Revert "tests: Check if BGP community-list filtering works correctly"

This reverts commit b08784281471bebb8b8dd4a97e558ae7cc078954.

2 years agoospfd: Adding per neighbour json details to GR helper detail command
rgirada [Mon, 22 Aug 2022 18:15:56 +0000 (11:15 -0700)]
ospfd: Adding per neighbour json details to GR helper detail command

Description:
Per neighbor GR enabled information is  missing from json
output in "show ip ospf gr helper details json" command.

      Example config:

frr(config-router)# graceful-restart helper enable 2.2.2.2
frr(config-router)#
frr(config-router)# do show ip ospf  graceful-restart helper  detail

       OSPF Router with ID (10.112.156.220)

Graceful restart helper support disabled.
Strict LSA check is enabled.
Helper supported for Planned and Unplanned Restarts.
Supported Graceful restart interval: 1800(in seconds).
Enable Router list:
2.2.2.2,

frr(config-router)# do show ip ospf  graceful-restart helper  detail json
{
 "routerId":"10.112.156.220",
 "helperSupport":"Disabled",
 "strictLsaCheck":"Enabled",
 "restartSupoort":"Planned and Unplanned Restarts",
 "supportedGracePeriod":1800,
}
frr(config-router)#

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agoospfd: changes for code maintainability
sri-mohan1 [Tue, 23 Aug 2022 16:45:38 +0000 (22:15 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2 years agoMerge pull request #11851 from sri-mohan1/sri-ospf-dbg1
Russ White [Tue, 23 Aug 2022 15:07:29 +0000 (11:07 -0400)]
Merge pull request #11851 from sri-mohan1/sri-ospf-dbg1

ospfd: changes for code maintainability

2 years agoMerge pull request #11820 from opensourcerouting/fix/clist_match
Russ White [Tue, 23 Aug 2022 15:06:15 +0000 (11:06 -0400)]
Merge pull request #11820 from opensourcerouting/fix/clist_match

bgpd: Fix community-list handling

2 years agoMerge pull request #11836 from ak503/nhrp_nbma
Philippe Guibert [Tue, 23 Aug 2022 15:06:02 +0000 (17:06 +0200)]
Merge pull request #11836 from ak503/nhrp_nbma

nhrpd: Use nhrp_interface_update_nbma when source vrf was changed

2 years agoMerge pull request #11840 from xdxu/master
Russ White [Tue, 23 Aug 2022 14:58:57 +0000 (10:58 -0400)]
Merge pull request #11840 from xdxu/master

ospf6d: Don't remove summary route if it is a range

2 years agoMerge pull request #11842 from opensourcerouting/fix/topotests_platform_check
Russ White [Tue, 23 Aug 2022 14:58:01 +0000 (10:58 -0400)]
Merge pull request #11842 from opensourcerouting/fix/topotests_platform_check

tests: Log as error if some of the daemons are missing

2 years agoMerge pull request #11843 from ARShreenidhi/ecmp_testcase
Russ White [Tue, 23 Aug 2022 14:57:13 +0000 (10:57 -0400)]
Merge pull request #11843 from ARShreenidhi/ecmp_testcase

tests : bgp-default-originate ecmp scenerio is added

2 years agoospfd: changes for code maintainability
sri-mohan1 [Tue, 23 Aug 2022 11:17:37 +0000 (16:47 +0530)]
ospfd: changes for code maintainability

these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>