Commit Graph

31325 Commits

Author SHA1 Message Date
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
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
Russ White
e1ee742b53
Merge pull request #12890 from pguibert6WIND/attr_cleaning_misc
bgp attribute cleaning misc
2023-03-07 09:46:24 -05:00
Russ White
bafc9c5dbf
Merge pull request #12940 from anlancs/fix/bfd-clean-echo
bfdd: remove useless check for ECHO packet
2023-03-07 09:33:33 -05:00
Russ White
44ff41e566
Merge pull request #12946 from opensourcerouting/fix/memory_leak_adj_out_set
bgpd: Intern attributes before putting into rib-out
2023-03-07 09:31:27 -05:00
Donald Sharp
b0d2fa3857 bgpd: Add missing items to debug for update group hash key creation
There are some missing values in the debug lines.  Let's add them
in and help us understand.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-07 07:58:27 -05:00
Donatas Abraitis
ae7b16b2d4
Merge pull request #12960 from anlancs/doc/some-words-doc
doc: Correct some words
2023-03-07 08:25:50 +02:00
Donatas Abraitis
f980f77ee0
Merge pull request #12934 from LabNConsulting/ziemba/rfapi-memleak-cleanup-12478
bgpd/rfapi: memleak: clean CE tables at exit
2023-03-06 21:19:36 +02:00
Donald Sharp
aca2040795
Merge pull request #12957 from opensourcerouting/fix/no_need_to_send_notification
bgpd: Do not send notification twice when parsing NLRI labels
2023-03-06 09:45:40 -05:00
Donald Sharp
694bb3fa75
Merge pull request #12958 from opensourcerouting/fix/commitlint_master_branch
tools: Do not run commit linter for other branches than master
2023-03-06 09:45:17 -05:00
Kuldeep Kashyap
7ce53cf7c7 tests: [PIMv6] Adding multicast pim6 SM testsuite
Automated new scenarios to multicast pim6
SM test suite. Added 10 test cases to verify
multicast PIM6-SM functionality.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Co-Auther: Vijay Kumar Gupta <vijayg@vmware.com>
2023-03-06 05:08:08 -08:00
Kuldeep Kashyap
54bf02c6dd tests: [PIMv6] F/W support for multicast pimv6 automation
Enhanced or added new libraries to support
multicast pimv6 automation

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
Co-Auther: Vijay Kumar Gupta <vijayg@vmware.com>
2023-03-06 05:08:08 -08:00
anlan_cs
c3e691229e doc: Correct some words
Note that `ASNUM` in table, it is missing right parenthesis for
`(1-4294967295)`. So, adjust this table.

And correct other words for doc.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-03-06 17:12:50 +08:00
Donatas Abraitis
754a054059 tools: Do not run commit linter for other branches than master
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-05 21:15:18 +02:00
Donatas Abraitis
bfeb86dfa8 bgpd: Do not send notification twice when parsing NLRI labels
This is already handled in bgp_nlri_parse() by checking error code.

Even more, we should send error sub-code to be according the NLRI type.

If it's MP_UPDATE/MP_WITHDRAW, sub-code should be an Optional Attribute error.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-05 20:58:26 +02:00
Donatas Abraitis
e618cc7b21
Merge pull request #12951 from donaldsharp/label_decode_crash
bgpd: Fix use beyond end of stream of labeled unicast parsing
2023-03-05 20:49:51 +02:00
Donatas Abraitis
0f46adebe4
Merge pull request #12950 from harryreps/master
babeld: fix #11808 to avoid infinite loops
2023-03-04 13:09:10 +02:00
Donald Sharp
7404a914b0 bgpd: Fix use beyond end of stream of labeled unicast parsing
Fixes a couple crashes associated with attempting to read
beyond the end of the stream.

Reported-by: Iggy Frankovic <iggyfran@amazon.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-03 22:38:50 -05:00
harryreps
ae1e0e1fed babeld: fix #11808 to avoid infinite loops
Replacing continue in loops to goto done so that index of packet buffer
increases.

Signed-off-by: harryreps <harryreps@gmail.com>
2023-03-03 23:19:33 +00:00
Mark Stapp
e879c3d8a2
Merge pull request #12935 from opensourcerouting/ospf6d-la-bit
ospf6d: fix processing of inter-area-prefix-LSAs with the LA-bit set
2023-03-03 15:38:32 -05:00
Mark Stapp
334b1188c2
Merge pull request #12937 from opensourcerouting/ospf6d-redist
ospf6d: small fixes in the handling of redistributed routes
2023-03-03 15:38:02 -05:00
Donatas Abraitis
84ef27fca3 bgpd: Intern attributes before putting into rib-out
```
==21860==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 80 byte(s) in 2 object(s) allocated from:
    0 0x7f8065294d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
    1 0x7f8064cfd216 in qcalloc lib/memory.c:105
    2 0x5646b7024073 in ecommunity_dup bgpd/bgp_ecommunity.c:252
    3 0x5646b7153585 in route_set_ecommunity_lb bgpd/bgp_routemap.c:2925
    4 0x7f8064d459be in route_map_apply_ext lib/routemap.c:2675
    5 0x5646b7116584 in subgroup_announce_check bgpd/bgp_route.c:2374
    6 0x5646b711b907 in subgroup_process_announce_selected bgpd/bgp_route.c:2918
    7 0x5646b717ceb8 in group_announce_route_walkcb bgpd/bgp_updgrp_adv.c:184
    8 0x7f8064cc6acd in hash_walk lib/hash.c:270
    9 0x5646b717ae0c in update_group_af_walk bgpd/bgp_updgrp.c:2046
    10 0x5646b7181275 in group_announce_route bgpd/bgp_updgrp_adv.c:1030
    11 0x5646b711a986 in bgp_process_main_one bgpd/bgp_route.c:3303
    12 0x5646b711b5bf in bgp_process_wq bgpd/bgp_route.c:3444
    13 0x7f8064da12d7 in work_queue_run lib/workqueue.c:267
    14 0x7f8064d891fb in thread_call lib/thread.c:1991
    15 0x7f8064cdffcf in frr_run lib/libfrr.c:1185
    16 0x5646b6feca67 in main bgpd/bgp_main.c:505
    17 0x7f8063f96c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)

Indirect leak of 16 byte(s) in 2 object(s) allocated from:
    0 0x7f8065294b40 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb40)
    1 0x7f8064cfcf01 in qmalloc lib/memory.c:100
    2 0x5646b7024151 in ecommunity_dup bgpd/bgp_ecommunity.c:256
    3 0x5646b7153585 in route_set_ecommunity_lb bgpd/bgp_routemap.c:2925
    4 0x7f8064d459be in route_map_apply_ext lib/routemap.c:2675
    5 0x5646b7116584 in subgroup_announce_check bgpd/bgp_route.c:2374
    6 0x5646b711b907 in subgroup_process_announce_selected bgpd/bgp_route.c:2918
    7 0x5646b717ceb8 in group_announce_route_walkcb bgpd/bgp_updgrp_adv.c:184
    8 0x7f8064cc6acd in hash_walk lib/hash.c:270
    9 0x5646b717ae0c in update_group_af_walk bgpd/bgp_updgrp.c:2046
    10 0x5646b7181275 in group_announce_route bgpd/bgp_updgrp_adv.c:1030
    11 0x5646b711a986 in bgp_process_main_one bgpd/bgp_route.c:3303
    12 0x5646b711b5bf in bgp_process_wq bgpd/bgp_route.c:3444
    13 0x7f8064da12d7 in work_queue_run lib/workqueue.c:267
    14 0x7f8064d891fb in thread_call lib/thread.c:1991
    15 0x7f8064cdffcf in frr_run lib/libfrr.c:1185
    16 0x5646b6feca67 in main bgpd/bgp_main.c:505
    17 0x7f8063f96c86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21c86)
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-03 17:33:51 +02:00
Donatas Abraitis
e119fbf851
Merge pull request #12942 from LabNConsulting/chopps/fixpause
tests: fix --pause functionality
2023-03-03 17:20:14 +02:00
G. Paul Ziemba
cd88639537 bgpd: rfapi memleak: clean CE tables at exit
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2023-03-03 07:03:40 -08:00
Christian Hopps
cad554442b tests: fix --pause functionality
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-03 07:19:22 -05:00
Christian Hopps
70de85d669
Merge pull request #12945 from opensourcerouting/fix/relax_a_bit_some_commitlint_rules
tools: Do not force Sentence-case for commit messages
2023-03-03 07:13:44 -05:00
Donatas Abraitis
70594ab7bd tools: Do not force Sentence-case for commit messages
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-03 14:10:36 +02:00
anlan_cs
c9aac2c38a bfdd: Remove useless check for ECHO packet
The check with `ip->daddr == ip->saddr` in `bfd_recv_ipv4_fp()` is
useless, instead of it the ECHO packets should simply exit with
TTL checking failure regardless of this condition check.

Just remove the check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2023-03-03 18:25:12 +08:00
Christian Hopps
bd0699e27a
Merge pull request #12943 from opensourcerouting/feature/add_helpurl
tools: Commit linter minor adjustments
2023-03-03 03:15:16 -05:00
Donatas Abraitis
f12331ff33 tools: Add missing mgmtd prefix for commitlint
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-03 10:11:51 +02:00
Donatas Abraitis
8cd0ea3c82 tools: Add missing pathd prefix for commitlint
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-03 10:07:06 +02:00
Donatas Abraitis
8b40b2f655 tools: Add help url when commitlint fails
Just point to our workflow documentation.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-03 10:05:53 +02:00
Renato Westphal
9629b44f45 ospfd: correctly update outbound filter-list once prefix-list is updated
Fix obvious bug where the wrong area filter-lists were being updated
in response to a prefix-list update.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
cb1f47c2eb ospfd, ospf6d: perform GR consistency check only when necessary
The GR code should check for topology changes only upon the receipt
of Router-LSAs and Network-LSAs. Other LSAs types don't affect the
topology as far as a restarting router is concerned.

This optimization reduces unnecessary computations when the
restarting router receives thousands of inter-area LSAs or external
LSAs while coming back up.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
a7276f0102 ospf6d: fix processing of inter-area-prefix-LSAs with the LA-bit set
RFC 5340, Section 4.8.3 says:
  "Prefixes having the NU-bit set in their PrefixOptions field should
  be ignored by the inter-area route calculation".

Fix a bug where, in addition to the NU-bit, ospf6d was also ignoring
prefixes having the LA-bit set when computing inter-area routes. In
practice, this fixes interoperability issues with vendors that set
the LA-bit in loopback prefixes (among other cases).

While here, fix a copy-and-paste error where a log message wasn't
showing accurate information about what happened.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
6861a5e462 ospf6d: handle redistributed routes without nexthop addresses
Do not assume that all redistributed routes have a nexthop address,
otherwise blackhole nexthops can be misinterpreted as IPv6 addresses,
leading to inconsistencies.

Also, change the signature of a few functions to allow const nexthop
addresses, such that in6addr_any can be used without type casts.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
3d2533ed58 ospf6d: fix missing intra-area-prefix-LSA after a graceful restart
Upon exiting the GR mode, force reorigination of intra-area-prefix-LSAs
on all attached areas. This is to ensure all configured areas will have
an associated intra-area-prefix-LSA at the end of the GR procedures,
even if the area doesn't have any full adjacency.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
73d9d322fe ospf6d: originate AS-External LSAs with a forwarding address
Originate AS-External LSAs with forwarding addresses whenever the
corresponding redistributed routes have a global nexthop address.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
5eb2c602aa ospf6d: fix refreshing of NSSA/AS-external LSAs after a graceful restart
This commit fixes a bug where self-originated NSSA/AS-External LSAs
would age out about one hour after exiting from the GR mode. The
reason is because received self-originated LSAs aren't registered
for periodic refreshing, so that needs to be done manually. Fix
this by explicitly reoriginating all NSSA/AS-External LSAs while
exiting from the GR mode.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
3a94ed5696 ospf6d: fix duplicate inter-area-prefix-LSAs after exiting from GR mode
An ABR that is originating inter-area-prefix-LSAs should take into
account the fact that there might be self-originated LSAs for the
same prefixes that were originated prior to a graceful restart. When
that happens, the previous LSA-IDs should be reused to avoid having
duplicate LSAs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
5cbcc459ae ospf6d: add exception for virtual links when exiting from the GR mode
RFC 5340 says that Link-LSAs should not be originated for virtual
links.  Add a check to prevent that from happening while exiting
from the GR mode.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00
Renato Westphal
e23e568319 ospf6d: update DR election to handle GR corner case
Consider the case where a DR router is performing a graceful restart,
and all neighbors attached to the DR network have their priorities
set to zero.

According to RFC 3623, the router should reclaim its DR status while
coming back up once it receives a Hello packet from a neighbor
listing the router as the DR, and the associated interface is in
Waiting state.

The problem arises when the DR election starts. Since the router
is already elected the DR, and no BDR will be elected (since all
neighbors have their priorities set to zero), the AdjOk event won't
be triggered at the end of the DR election as it would normally
happen. That causes all neighbors reachable over the broadcast
interface to get stuck in the 2-Way state.

Fix this corner case by always triggering the AdjOk event at the
end of the DR election process when a GR is in progress. Triggering
the AdjOk event when not necessary should never be a problem as
the neighbor FSM is already prepared to deal with that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2023-03-02 19:38:03 -03:00