Commit Graph

29651 Commits

Author SHA1 Message Date
Donatas Abraitis
b5132009fc
Merge pull request #11718 from SaiGomathiN/mldgroups
pim6d: Implementing "show ipv6 mld groups" CLI
2022-08-26 15:19:32 +03:00
Donatas Abraitis
5e48498795
Merge pull request #11844 from SaiGomathiN/ttable-1
pimd, pim6d: Using ttable for displaying show CLIs
2022-08-26 11:48:18 +03:00
Sai Gomathi N
523a644796 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>
2022-08-26 01:14:08 -07:00
Sai Gomathi N
cdc1b7709f pim6d: Implementing "show mld groups" CLI
To Display MLD Group information

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-26 01:14:08 -07:00
Sai Gomathi N
8934215f65 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>
2022-08-26 01:14:08 -07:00
sri-mohan1
1396917dde ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-26 13:01:37 +05:30
Donatas Abraitis
1823510862
Merge pull request #11854 from donaldsharp/memory_walk_in_gdb
gdb: Add a macro to walk memory allocations
2022-08-26 10:20:58 +03:00
mobash-rasool
c4d9ff5f1a
Merge pull request #11862 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-26 12:08:53 +05:30
sri-mohan1
ea892800dd ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-25 23:48:24 +05:30
Donald Sharp
0824a0020d
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
2022-08-25 13:20:19 -04:00
Donald Sharp
373dce6d11
Merge pull request #11858 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-25 09:25:10 -04:00
Mark Stapp
d4fc18584b
Merge pull request #11859 from liwg06/master.fix.extra.semicolon
lib: Fix extra semicolon after if
2022-08-25 08:53:36 -04:00
Donatas Abraitis
036f482fce bgpd: Drop bnc_str() function
Reuse %pFX -> prefix2str()

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-25 14:35:28 +03:00
Donatas Abraitis
511211bf56 bgpd: Convert prefix2str to %pFX
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-08-25 14:35:27 +03:00
Donatas Abraitis
2bf9780b26 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>
2022-08-25 13:15:27 +03:00
Weiguo Li
51a68f9b3e lib: Fix extra semicolon after if
Signed-off-by: Weiguo Li <liwg06@foxmail.com>
2022-08-25 17:52:21 +08:00
sri-mohan1
e6f3b2621b ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-24 23:34:41 +05:30
Sai Gomathi N
d250853af7 pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim jp-agg" CLI
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-24 09:25:55 -07:00
Sai Gomathi N
7d11f1996e pimd, pim6d: Using ttable for displaying "show ip|ipv6 pim channel" CLI
Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2022-08-24 09:25:55 -07:00
Jafar Al-Gharaibeh
8783ed4bb4
Merge pull request #11829 from donaldsharp/time_32_bits
Time 32 bits
2022-08-24 11:25:16 -05:00
Mark Stapp
28e3928163
Merge pull request #11856 from opensourcerouting/fix/revert_clist_internet
bgpd: Revert community-list INTERNET stuff
2022-08-24 09:32:19 -04:00
Donald Sharp
1568e88a8e ripd: Use a sequence number instead of time
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-24 08:30:42 -04:00
Donald Sharp
c392d9f487 babeld: Remove return value for gettime()
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-24 08:30:27 -04:00
Donald Sharp
ef03888333 zebra: Convert time to uint64_t for zclient data structures
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-24 08:29:50 -04:00
Donald Sharp
bce18b18fe 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>
2022-08-24 08:28:51 -04:00
Donald Sharp
98b7e9754c bgpd: Replace rfapi_time() with monotime()
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-08-24 08:28:51 -04:00
Donald Sharp
083ec940ab 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>
2022-08-24 08:23:40 -04:00
Carmine Scarpitta
877682e328 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>
2022-08-24 14:22:04 +02:00
Carmine Scarpitta
6dece5ac29 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>
2022-08-24 14:22:04 +02:00
Carmine Scarpitta
a0c47583a4 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>
2022-08-24 14:22:04 +02:00
Carmine Scarpitta
f8e9c702a1 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>
2022-08-24 14:22:04 +02:00
Donald Sharp
1a6c318d64 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>
2022-08-24 07:13:29 -04:00
Donatas Abraitis
9e7103f6b7
Merge pull request #11848 from rgirada/ospf_gr_nbr
ospfd: Adding per neighbour json details to GR helper detail command
2022-08-24 12:39:13 +03:00
Carmine Scarpitta
bda15542f4 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>
2022-08-24 08:56:46 +02:00
Carmine Scarpitta
03852f673b 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>
2022-08-24 08:53:08 +02:00
Carmine Scarpitta
d0c775e3eb 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>
2022-08-24 08:41:45 +02:00
Carmine Scarpitta
0a58467251 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>
2022-08-24 08:38:22 +02:00
Donatas Abraitis
e02865fe34
Merge pull request #11853 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-24 09:19:51 +03:00
Donatas Abraitis
ff8f74b68e 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>
2022-08-24 08:59:25 +03:00
Donatas Abraitis
b6dbdee5ad Revert "bgpd: Drop internet community check from community_list_match()"
Seems that, `internet` community is used to match ANY community.

This reverts commit e605d0cfae.
2022-08-24 08:46:56 +03:00
Donatas Abraitis
e317aea23f Revert "tests: Check if BGP community-list filtering works correctly"
This reverts commit b087842814.
2022-08-24 08:46:47 +03:00
rgirada
7b71c1e3f7 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>
2022-08-23 21:15:12 -07:00
sri-mohan1
921b959602 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-23 22:18:33 +05:30
Russ White
c143b87519
Merge pull request #11851 from sri-mohan1/sri-ospf-dbg1
ospfd: changes for code maintainability
2022-08-23 11:07:29 -04:00
Russ White
abeb15e9cf
Merge pull request #11820 from opensourcerouting/fix/clist_match
bgpd: Fix community-list handling
2022-08-23 11:06:15 -04:00
Philippe Guibert
04931fa90a
Merge pull request #11836 from ak503/nhrp_nbma
nhrpd: Use nhrp_interface_update_nbma when source vrf was changed
2022-08-23 17:06:02 +02:00
Russ White
37f88e58bf
Merge pull request #11840 from xdxu/master
ospf6d: Don't remove summary route if it is a range
2022-08-23 10:58:57 -04:00
Russ White
7a15a3d2fc
Merge pull request #11842 from opensourcerouting/fix/topotests_platform_check
tests: Log as error if some of the daemons are missing
2022-08-23 10:58:01 -04:00
Russ White
f3b1f6fe59
Merge pull request #11843 from ARShreenidhi/ecmp_testcase
tests : bgp-default-originate ecmp scenerio is added
2022-08-23 10:57:13 -04:00
sri-mohan1
f96ec6a674 ospfd: changes for code maintainability
these changes are for improving the code maintainability

Signed-off-by: sri-mohan1 <sri.mohan@samsung.com>
2022-08-23 16:50:54 +05:30