Commit Graph

32667 Commits

Author SHA1 Message Date
rgirada
e6f3d0811d ospfd: Ospf ABR doesnt Advertise LSA summary
Description:
	OSPF ABR will summarise the networks based on configured range
	and re-advtertise the summarised route. But if configured range
	prefix id is same as one of the subset of routes prefix id then
	as per rcf2328 Appendex-E recommendation, it will prepare the LSID and originate.
	While re-advertising, it is using ospf LSDB instead of area specific
	LSDB which is making it fail to re-advertise the summary lsa.
	Fixed this by passing correct LSDB pointer.

Issue: #12995

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-03-17 10:11:28 +00:00
Donatas Abraitis
6c634d2912
Merge pull request #13012 from donaldsharp/hold_time_reset
bgpd: Always restart timer from scratch in OpenConfirm/Established
2023-03-17 12:04:28 +02:00
Martin Winter
386d232a1a ospfd: Log Adjacency Changes with Neighbor IP in addition to Neighbor ID
Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-17 10:17:52 +02:00
Donatas Abraitis
ba427e6348 ospfd, ospf6d: Add more logging details
Basically just router-id or interface/IP.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-17 10:14:26 +02:00
Donatas Abraitis
a550e3446c
Merge pull request #13009 from donaldsharp/nexthop_use_interface_name
bgpd: Use interface name instead of pointer value
2023-03-17 09:56:00 +02:00
Sai Gomathi N
6339167300 pim6d: Custom error-message for non-multicast groups
While configuring global or non-multicast address for IPv6 mld join command,
displaying a custom error-message "invalid multicast address"

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2023-03-16 22:13:26 -07:00
Donald Sharp
aa554d4b65 bgpd: Always restart timer from scratch in OpenConfirm/Established
Imagine this scenario:

A peer has very large hold/keepalive timers of 600/200.  This peer is
using the DataCenter default time.  As such the open will cause
the t_holdtime to be negotiated to 600 seconds.  Now also imagine
that both peers are in update-delay.  If we do not restart the
timers and both peers are in Update Delay, we will continously
reset the peer because the hold time will be hit( since the peer
is not sending us any data ).

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-16 19:23:38 -04:00
Donald Sharp
090109617e
Merge pull request #12999 from opensourcerouting/fix/bgp_leaks_random_stuff
bgpd: aggregate routes memory leak for aspath
2023-03-16 19:12:55 -04:00
Donald Sharp
e2e8f8dd51 lib: Speedup prefix-list readin by a large factor
Reading in prefix-lists is reading in the specified
prefix list and validating that the prefix is unique
2 times.  This makes no sense.  Relax the requirement
that a prefix list can limit this as well as completely
remove this check.  Validation then just becomes
does this prefix-list specified actually make sense
and that is taken care of by the the cli code.

Reading in prefix-lists was looking for duplicate prefixes
2 times instead of doing it just one time.  Let's just
not do it at all.

By doing this change, The code changes from never
completing for a 27k long prefix-list to taking
just under 30 seconds, with 4 daemons processing
this data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-16 10:40:35 -04:00
Donald Sharp
50e049db76 bgpd: Use interface name instead of pointer value
Log message is borked in a manner that makes it unusable:
bgpd[52]: [VX6SM-8YE5W][EC 33554460] 2000:31:0:53::2: nexthop_set failed, resetting connection - intf 0x561eb9005a30

Let's print out the interface name instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-16 10:26:01 -04:00
Donald Sharp
9a02d9a3bc
Merge pull request #13006 from opensourcerouting/bgp-gr-null-warning
bgpd: fix NULL argument warning
2023-03-16 07:41:10 -04:00
David Lamparter
4b216f58dc bgpd: fix NULL argument warning
gcc 12.2.0 complains `error: ‘%s’ directive argument is null`, even
though all enum values are covered with a string.  Let's just go with a
`???` default.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-03-16 11:00:02 +01:00
anlan_cs
5b498ae7ec yang, bgpd: Fix "aggregator-asn" to support asdot
The following command is not working:

 > (routemap)  set aggregator as ASNUM A.B.C.D

Since "aggregator-asn" has already supported asdot,
fixed it with new yang type. Extra ASN validation
(leading zeroes for instance) are done in the validate
hook of the yang leaf.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-16 07:00:53 +01:00
Donald Sharp
9b3cebe228
Merge pull request #13002 from opensourcerouting/fix/missing_bgp_dest_unlock_node_leak_update 2023-03-15 21:54:15 -04:00
Mark Stapp
c3ff85a7e2
Merge pull request #12998 from opensourcerouting/clippy-python-init-api
lib: adapt clippy to Python 3.8+ init API
2023-03-15 11:33:35 -04:00
David Lamparter
9fcc2ae596 lib: adapt clippy to Python 3.8+ init API
The old initialization/config API is deprecated in Python 3.11.  Make
clippy use the new one added in 3.8 if it's that version or newer.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-03-15 13:52:35 +01:00
Donatas Abraitis
8ea624a496 bgpd: Unlock bgp dest node if leak_update() fails
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-15 14:52:21 +02:00
Mark Stapp
b8d099e02b
Merge pull request #12982 from opensourcerouting/fix/commmitlint_condition
tools: Use specific syntax for conditions for Github actions
2023-03-15 08:20:48 -04:00
Donatas Abraitis
100f2249d3 bgpd: Free previously dup'ed aspath attribute for aggregate routes
Fixes memory leak:

```
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233:Direct leak of 80 byte(s) in 2 object(s) allocated f
rom:
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    0 0x7fcce641b037 in __interceptor_calloc ../../
../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    1 0x7fcce601f874 in qcalloc lib/memory.c:105
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    2 0x55a9594c805e in aspath_dup bgpd/bgp_aspath.c:688
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    3 0x55a9594cf55b in bgp_aggr_aspath_prepare bgpd/bgp_aspath.c:2164
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    4 0x7fcce5fbc95a in hash_iterate lib/hash.c:252
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    5 0x55a9594cf82f in bgp_compute_aggregate_aspath_val bgpd/bgp_aspath.c:2223
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    6 0x55a9594cf5db in bgp_compute_aggregate_aspath bgpd/bgp_aspath.c:2179
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    7 0x55a9592740fb in bgp_add_route_to_aggregate bgpd/bgp_route.c:8035
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    8 0x55a9592750ec in bgp_aggregate_increment bgpd/bgp_route.c:8234
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    9 0x55a959263174 in bgp_update bgpd/bgp_route.c:4797
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    10 0x55a9592696c9 in bgp_nlri_parse_ip bgpd/bgp_route.c:6070
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    11 0x55a959210649 in bgp_nlri_parse bgpd/bgp_packet.c:339
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    12 0x55a95921a3a1 in bgp_update_receive bgpd/bgp_packet.c:2023
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    13 0x55a95922159b in bgp_process_packet bgpd/bgp_packet.c:2933
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    14 0x7fcce60eaa50 in thread_call lib/thread.c:1991
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    15 0x7fcce5fe2e54 in frr_run lib/libfrr.c:1185
./bgp_local_asn_dot.test_bgp_local_asn_dot_agg/r3.bgpd.asan.653233-    16 0x55a9590d256d in main bgpd/bgp_main.c:505
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-15 13:34:56 +02:00
Donatas Abraitis
9bea1b4bec bgpd: Unlock dest if we return earlier for aggregate install
If the bgp is in shutdown state or so, do not forget to unlock the dest node.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-15 13:34:55 +02:00
Donatas Abraitis
e11791f475 bgpd: Free dup'ed attributes for aggregate routes with route-maps
If route-map deny match is returned, we should free previously dup'ed
attributes: aspath, community, large community, extended community.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-15 11:35:00 +02:00
Donatas Abraitis
1c3fca84ad
Merge pull request #12996 from chiragshah6/fdev1
tools: frr-reload fix list value not present
2023-03-15 10:21:02 +02:00
Donatas Abraitis
52523db51c
Merge pull request #12310 from kuldeepkash/pim_v6
tests: [PIMv6] Adding multicast pim6 SM testsuite
2023-03-15 08:55:24 +02:00
Chirag Shah
1543f58b55 tools: frr-reload fix list value not present
Check for value present in list before removing
as in certain python3 ValueError traceback is observed.

Traceback (most recent call last):
  File "/usr/lib/frr/frr-reload.py",
		line 2278, in <module>
    (lines_to_add, lines_to_del, restart_frr)
	= compare_context_objects(newconf, running)
  File "/usr/lib/frr/frr-reload.py",
		line 1933, in compare_context_objects
    lines_to_add, lines_to_del
  File "/usr/lib/frr/frr-reload.py",
		line 1549, in ignore_delete_re_add_lines
    lines_to_del.remove((ctx_keys, line))
ValueError: list.remove(x): x not in list

Ticket:#3389979
Issue:3389979

Testing Done:
With fix perform frr-relaod on frr.conf config where earlier
traceback was seen.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
2023-03-14 21:32:40 -07:00
Russ White
6f5f572b9c
Merge pull request #12936 from opensourcerouting/ospf6d-out-filter-list
ospfd: correctly update outbound filter-list once prefix-list is updated
2023-03-14 11:33:44 -04:00
Russ White
52b5aeed95
Merge pull request #12990 from opensourcerouting/fix/rename_bgp_afi_node_lookup
bgpd: Drop afi from lookup functions (not used)
2023-03-14 10:16:16 -04:00
Russ White
e5325ec96a
Merge pull request #12989 from opensourcerouting/fix/memory_leaks_bgpd
bgpd: Free memory allocated by ecommunity_ecom2str()
2023-03-14 10:15:07 -04:00
Russ White
0fdd5742a0
Merge pull request #12979 from miegl/isis_tun
isisd: IS-IS over tunnel (GRE, GENEVE)
2023-03-14 10:05:01 -04:00
Russ White
cff3239215
Merge pull request #12965 from donaldsharp/gr_vrf_aware
zebra: Make GR debug logs at least vrf aware
2023-03-14 08:45:02 -04:00
Russ White
4c88ac57d7
Merge pull request #12922 from opensourcerouting/ospf-gr-fixes
OSPF Graceful Restart fixes
2023-03-14 08:38:36 -04:00
Donatas Abraitis
0da34e499a bgpd: Drop afi_t from bgp_evpn_global_node_lookup()
Not used.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-14 12:05:58 +02:00
Donatas Abraitis
59d6b4d6ab bgpd: Rename bgp_afi_node_lookup() to bgp_safi_node_lookup()
afi not used in this function, reduce a bit.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-14 12:01:56 +02:00
Donatas Abraitis
9dc5d874a0 bgpd: Free memory allocated by ecommunity_ecom2str()
Return local string, copied from returned value of ecom2str.

```
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690:Direct leak of 528 byte(s) in 8 object(s) allocated from:
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    0 0x7efcde5d6037 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    1 0x7efcde1dc7e2 in qcalloc lib/memory.c:105
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    2 0x5628a0592704 in ecommunity_ecom2str bgpd/bgp_ecommunity.c:947
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    3 0x7efcdaa558c8 in mplsL3vpnVrfRtTable bgpd/bgp_mplsvpn_snmp.c:1152
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-    4 0x7efcda784139 in netsnmp_old_api_helper helpers/old_api.c:332
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-
./bgp_snmp_mplsl3vpn.test_bgp_snmp_mplsvpn/r1.bgpd.asan.2925690-SUMMARY: AddressSanitizer: 528 byte(s) leaked in 8 allocation(s).
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-14 11:07:48 +02:00
mobash-rasool
3ae6704b20
Merge pull request #12978 from donaldsharp/multicast_address
pimd: IN_MULTICAST needs host order
2023-03-14 11:18:35 +05:30
Donatas Abraitis
b3b0679cb0 tools: Use specific syntax for conditions for Github actions
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-13 09:52:13 +02:00
Donatas Abraitis
3ac291b526
Merge pull request #12974 from donaldsharp/update_versioning
bgpd: Increment version number even when no data is sent
2023-03-12 21:48:49 +02:00
Josef Miegl
a0956b9522 isisd: pfpacket BPF filter with IS-IS over tunnel support
Signed-off-by: Josef Miegl <josef@miegl.cz>
2023-03-12 16:15:27 +01:00
Donatas Abraitis
8e09dce6bf
Merge pull request #12923 from donaldsharp/update_group_debug
bgpd: Add missing items to debug for update group hash key creation
2023-03-12 15:51:51 +02:00
Donald Sharp
8083e71356 pimd: IN_MULTICAST needs host order
New correct behavior:

eva# conf
eva(config)# ip pim rp 192.168.1.224 224.0.0.0/24
No Path to RP address specified: 192.168.1.224
eva(config)# ip pim rp 224.1.2.3 224.0.0.0/24
% Bad RP address specified: 224.1.2.3
eva(config)#

Fixes: #12970
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-11 19:39:22 -05:00
Donald Sharp
a8038460bd bgpd: Increment version number even when no data is sent
When an update group decides to not send a prefix
announcement because it has not changed, still increment
the version number.  Why?  To allow for the situation
where you have say 2 peers in 1 peer group and shortly
after they come up a 3rd peer comes up.  It will be
placed into a separate update group and could be
coalesced down, when it finishes updating all data
to it.  Now imagine that a single prefix changes at
this point in time as well.  Then first 2 peers may
decide to not send the data, since nothing has changed.
While the 3rd peer will and since the versions numbers
never match they will never coalesce.  So when the decision
is made to skip, update the version number as well.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-11 12:09:23 -05:00
Jafar Al-Gharaibeh
660d14e18b
Merge pull request #12962 from opensourcerouting/fix/bgpd_ipv6_ll_peering
bgpd: Check if the peer is configured as interface when checking NHT
2023-03-10 23:09:07 -06:00
Donald Sharp
3bde1a53cc
Merge pull request #12967 from pguibert6WIND/show_zebra_mpls_empty 2023-03-10 17:53:46 -05:00
Donald Sharp
115ccb9acf lib, bgpd: Add more debugs to GR Capability exchange
a) Make it legible what type of message is being passed
back and forth instead of having to guess it from
the insufficient debugs

b) Make it explicit which bgp instance is sending this
data

c) Cleanup bgp_zebra_update to have a cleaner api

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-09 08:36:51 -05:00
Philippe Guibert
060c7d7073 zebra: add json support when "show zebra mpls" returns nothing
The "show zebra mpls .. json" vty command may return empty information
in case the MPLS database is empty or a given label entry is not
available. When those errors occur, add the braces to return a
valid json format.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2023-03-09 09:44:14 +01:00
Donald Sharp
edacb45c0c zebra: Make GR debug logs at least vrf aware
The GR debug logs are doing all sorts of wonderful stuff
but they were not actually displaying anything useful to the operator
about what vrf we are operating in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-08 13:26:16 -05:00
Donatas Abraitis
d7917c2541
Merge pull request #12963 from anlancs/fix/bgpd-keep-common
bgpd: Simplify the code for show command
2023-03-08 16:12:03 +02:00
anlan_cs
344c7da04e bgpd: Simplify the code for show command
Keep the common code for command: "show ip bgp summary [wide]".

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-03-08 16:10:05 +08:00
Xiao Liang
af19624b00 zebra: Add link_nsid to zebra interface
Create VRF and interfaces:

    ip netns add vrf1
    ip link add veth1 index 100 type veth
    ip link add link veth1 veth1.200 type vlan id 200
    ip link set veth1.200 netns vrf1
    ip -n vrf1 link add veth2 index 100 type veth

After reloading zebra, "show interface veth1.200" shows wrong parent
interface:

    test# show interface veth1.200
    Interface veth1.200 is down
      ...
      Parent interface: veth2

This is because veth1.200 and veth1 are in different netns, and veth2
happens to have the same ifindex as veth1, in the same netns of
veth1.200.
When looking for parent, link-ifindex 100 should be looked up within
link-netns, rather than that of the child interface.

Add link_nsid to zebra interface, so that the <link_nsid, link_ifindex>
pair can uniquely identify the link interface.

Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
2023-03-08 09:57:18 +08:00
Donatas Abraitis
0f4a09ac25 tests: Check if IPv6 BGP Link-Local peering works
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-07 22:45:03 +02:00
Donatas Abraitis
e9ad26e53f bgpd: Check if the peer is configured as interface when checking NHT
This causes early return. peer->conf is NULL for IPv6 link-local peering,
and the session never establish.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-07 22:36:15 +02:00