]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
2 years agolib: fix the right value is returned for fail cases
anlan_cs [Wed, 12 Jan 2022 12:53:25 +0000 (07:53 -0500)]
lib: fix the right value is returned for fail cases

Currently `bfd_get_peer_info` should return invalid sp->family
and dp->family during fail cases.

Before this fix, in those fail cases `bfd_get_peer_info` maybe
return valid sp->family and dp->family.

This fix ensures all fail cases return invalid sp->family and
dp->family for outside callers.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10317 from ton31337/fix/shutdown_msg
Igor Ryzhov [Wed, 12 Jan 2022 11:36:58 +0000 (14:36 +0300)]
Merge pull request #10317 from ton31337/fix/shutdown_msg

bgpd: Make sure we are playing with non-NULL for bgp shutdown message

2 years agoMerge pull request #10315 from ckishimo/ospf6d_cleaning
Igor Ryzhov [Wed, 12 Jan 2022 11:35:44 +0000 (14:35 +0300)]
Merge pull request #10315 from ckishimo/ospf6d_cleaning

ospf6d: some cleaning

2 years agoMerge pull request #9285 from anlancs/fix-ospf6d-cli-with-nonexist-vrf
Igor Ryzhov [Wed, 12 Jan 2022 11:26:28 +0000 (14:26 +0300)]
Merge pull request #9285 from anlancs/fix-ospf6d-cli-with-nonexist-vrf

ospf6d: add prompt for commands with non-exist vrf

2 years agoMerge pull request #9292 from mobash-rasool/ospfv3-bug2
Igor Ryzhov [Wed, 12 Jan 2022 11:25:17 +0000 (14:25 +0300)]
Merge pull request #9292 from mobash-rasool/ospfv3-bug2

ospfv3 is showing enabled on loopback interface although it is not

2 years agoMerge pull request #10320 from anlancs/ospf-one-word
Donatas Abraitis [Wed, 12 Jan 2022 08:42:02 +0000 (10:42 +0200)]
Merge pull request #10320 from anlancs/ospf-one-word

ospfd: correct one word of the output message

2 years agoMerge pull request #10312 from anlancs/bfd-rename-ttl
Rafael Zalamena [Tue, 11 Jan 2022 17:30:05 +0000 (14:30 -0300)]
Merge pull request #10312 from anlancs/bfd-rename-ttl

lib: rename one bfd parameter name to reflect real meaning

2 years agoMerge pull request #10235 from proelbtn/srv6-soft-reconf
Russ White [Tue, 11 Jan 2022 16:03:34 +0000 (11:03 -0500)]
Merge pull request #10235 from proelbtn/srv6-soft-reconf

SRv6 routes aren't inserted into data plane correctly with soft-reconfiguration

2 years agobgpd: Make sure we are playing with non-NULL for bgp shutdown message
Donatas Abraitis [Tue, 11 Jan 2022 10:24:41 +0000 (12:24 +0200)]
bgpd: Make sure we are playing with non-NULL for bgp shutdown message

```
*** CID 1510738:  Null pointer dereferences  (FORWARD_NULL)
/bgpd/bgp_vty.c: 4243 in bgp_shutdown_msg_magic()
4237            if (msgstr && strlen(msgstr) > BGP_ADMIN_SHUTDOWN_MSG_LEN) {
4238                    vty_out(vty, "%% Shutdown message size exceeded %d\n",
4239                            BGP_ADMIN_SHUTDOWN_MSG_LEN);
4240                    return CMD_WARNING_CONFIG_FAILED;
4241            }
4242
>>>     CID 1510738:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "msgstr" to "bgp_shutdown_enable", which dereferences it.
4243            bgp_shutdown_enable(bgp, msgstr);
4244            XFREE(MTYPE_TMP, msgstr);
4245
4246            return CMD_SUCCESS;
4247     }
4248
```

```
*** CID 1510737:  Null pointer dereferences  (REVERSE_INULL)
/bgpd/bgpd.c: 4344 in bgp_shutdown_enable()
4338                    /* continue, if peer is already in administrative shutdown. */
4339                    if (CHECK_FLAG(peer->flags, PEER_FLAG_SHUTDOWN))
4340                            continue;
4341
4342                    /* send a RFC 4486 notification message if necessary */
4343                    if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
>>>     CID 1510737:  Null pointer dereferences  (REVERSE_INULL)
>>>     Null-checking "msg" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
4344                            if (msg)
4345                                    bgp_notify_send_with_data(
4346                                            peer, BGP_NOTIFY_CEASE,
4347                                            BGP_NOTIFY_CEASE_ADMIN_SHUTDOWN, data,
4348                                            datalen + 1);
4349                            else
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoospfd: correct one word of the output message
anlan_cs [Tue, 11 Jan 2022 13:51:22 +0000 (08:51 -0500)]
ospfd: correct one word of the output message

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoospf6d: add missing htons
ckishimo [Mon, 10 Jan 2022 17:02:16 +0000 (18:02 +0100)]
ospf6d: add missing htons

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: fix typos
ckishimo [Mon, 10 Jan 2022 13:56:34 +0000 (14:56 +0100)]
ospf6d: fix typos

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: use __func__
ckishimo [Mon, 10 Jan 2022 13:50:59 +0000 (14:50 +0100)]
ospf6d: use __func__

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoMerge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix
David Lamparter [Tue, 11 Jan 2022 09:32:16 +0000 (10:32 +0100)]
Merge pull request #10212 from mobash-rasool/mld-pim6-dev-prefix

2 years agoospf6d: give error information for commands with non-exist vrfs
anlan_cs [Tue, 11 Jan 2022 09:21:05 +0000 (04:21 -0500)]
ospf6d: give error information for commands with non-exist vrfs

Currently the ospf6d's commands with non-exist vrfs can't give the error
informations to users.

This commit adds a macro "OSPF6_CMD_CHECK_VRF" to give error information
if with non-exist vrfs. As usual, skip the checking process in the case
of json.

So one command can call this macro to do the checking process in its
end. At that time it need know json style or not, so add "json" parameter for
several related functions.

BTW, suppress the build warning of the macro `OSPF6_FIND_VRF_ARGS`:
"Macros starting with if should be enclosed by a do - while loop to avoid
possible if/else logic defects."

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10313 from anlancs/fix-ospf-check
Igor Ryzhov [Tue, 11 Jan 2022 08:32:12 +0000 (11:32 +0300)]
Merge pull request #10313 from anlancs/fix-ospf-check

ospfd,ospf6d: fix wrong comparison of routemap name

2 years agopimd: Modifying in_addr to pim_addr in struct pim_neighbor and gm_sock
sarita patra [Tue, 14 Dec 2021 12:25:40 +0000 (04:25 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_neighbor and gm_sock

Changed struct in_addr source_addr to struct PIM_ADDR source_addr
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_upstream for IPv6.
sarita patra [Tue, 14 Dec 2021 12:22:28 +0000 (04:22 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_upstream for IPv6.

Changed struct in_addr upstream_addr and struct in_addr upstream_register
to struct PIM_ADDR upstream_addr and struct PIM_ADDR upstream_register
which are to be used in both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_nexthop for IPv6.
sarita patra [Tue, 14 Dec 2021 12:17:29 +0000 (04:17 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_nexthop for IPv6.

Changed struct in_addr last_lookup to struct PIM_ADDR last_lookup
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct igmp_group for IPv6.
sarita patra [Mon, 13 Dec 2021 14:03:31 +0000 (06:03 -0800)]
pimd: Modifying in_addr to pim_addr in struct igmp_group for IPv6.

Changed struct in_addr group_addr to struct PIM_ADDR group_addr
in struct igmp_group which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_iface_upstream_switch
sarita patra [Mon, 13 Dec 2021 14:01:36 +0000 (06:01 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_iface_upstream_switch

Changed struct in_addr address to struct pim_addr in struct
pim_iface_upstream_switch which is to be used in both IPv4
and IPv6(Both MLD and IGMP).

Reviewed-by: Mobashshera Rasool <mrasool@vmware.com>
Signed-off-by: sarita patra <saritap@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_jp_agg_group for IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 07:42:29 +0000 (23:42 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_jp_agg_group for IPv6

Changed struct in_addr group to struct pim_addr group
which is to be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in igmp_source for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 10:02:48 +0000 (02:02 -0800)]
pimd: Modifying in_addr to pim_addr in igmp_source for IPv6.

Changed struct in_addr source_addr to pim_addr source_addr
in struct igmp_source which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).

Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in igmp_join for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 07:12:29 +0000 (23:12 -0800)]
pimd: Modifying in_addr to pim_addr in igmp_join for IPv6.

Changed struct in_addr source_addr to pim_addr source_addr
in struct igmp_join which is to be used in
both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:31:39 +0000 (22:31 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_interface for IPv6

Based on compiler option, pim_addr will be changed to in_addr
or in6_addr for pimd and pim6d respectively.
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modify in_addr to pim_addr in pim_assert_metric
Mobashshera Rasool [Tue, 14 Dec 2021 06:28:46 +0000 (22:28 -0800)]
pimd: Modify in_addr to pim_addr in pim_assert_metric

This change is to accomodate IPv6 and IPv4 in the same code.
Based on pimd or pim6d, this will be compiled.
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.
Mobashshera Rasool [Tue, 14 Dec 2021 06:20:37 +0000 (22:20 -0800)]
pimd: Modifying in_addr to pim_addr in struct pim_ifchannel for IPv6.

Changed struct in_addr ifassert_winner to pim_addr
which will be used in both IPv4 and IPv6(Both MLD and IGMP).
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoospfd,ospf6d: make clear the comparison of routemap name
anlan_cs [Tue, 11 Jan 2022 01:45:10 +0000 (20:45 -0500)]
ospfd,ospf6d: make clear the comparison of routemap name

Comparison of the two pointer is confusing, they have no relevance
except the time both of them are empty.

Additionly modify one variable name and correct some comment words, they
are same in both ospfd and ospf6d.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoospf6d: remove duplicated code
ckishimo [Mon, 10 Jan 2022 13:34:24 +0000 (14:34 +0100)]
ospf6d: remove duplicated code

The OSPF6_LSA_UNAPPROVED flag is set in the function above
ospf6_lsa_translated_nssa_new, so there is no need to set
the flag again

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: remove double htons
ckishimo [Mon, 10 Jan 2022 13:32:48 +0000 (14:32 +0100)]
ospf6d: remove double htons

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agoospf6d: remove duplicated log
ckishimo [Mon, 10 Jan 2022 13:29:11 +0000 (14:29 +0100)]
ospf6d: remove duplicated log

When running topotest ospf6_topo2 we can see a log message with wrong lsa id

2021/12/20 23:14:40.330 OSPF6: [V8P0C-HB5Z2] ASBR[default:Status:3]: Update
2021/12/20 23:14:40.330 OSPF6: [Z489N-JAJ6P] ASBR[default:Status:3]: Already ASBR
2021/12/20 23:14:40.330 OSPF6: [Z9D0B-12SBJ] Redistribute 2001:db8:2::/64 (connected)
2021/12/20 23:14:40.330 OSPF6: [N66XP-ANN4G] Advertise as AS-External Id:8.70.41.177 prefix 2001:db8:2::/64 metric 2   (**)
2021/12/20 23:14:40.330 OSPF6: [K4Y9R-C22T6] Advertise new AS-External Id:0.0.0.3 prefix 2001:db8:2::/64 metric 2
2021/12/20 23:14:40.330 OSPF6: [PKX0N-KNRQR] Originate AS-External-LSA for 2001:db8:2::/64

This PR removes the log (instead of fixing it) as same information is printed
in the following entry

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
2 years agolib: rename one bfd parameter name to reflect real meaning
anlan_cs [Mon, 10 Jan 2022 12:40:48 +0000 (07:40 -0500)]
lib: rename one bfd parameter name to reflect real meaning

As to "struct bfd_session_arg", just rename parameter "ttl" to "hops", in order
to  reflect real meaning.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10299 from donaldsharp/various_stuff
Donatas Abraitis [Mon, 10 Jan 2022 13:10:51 +0000 (15:10 +0200)]
Merge pull request #10299 from donaldsharp/various_stuff

Various stuff

2 years agoospf6d: remove ospf6Enabled from json output after deprecation cycle
Mobashshera Rasool [Wed, 4 Aug 2021 12:00:10 +0000 (05:00 -0700)]
ospf6d: remove ospf6Enabled from json output after deprecation cycle

Since ospf6Enabled and attachedToArea are denoting the same thing.
It is decided to remove ospf6Enabled from json output to make
CLI and json output similar.

Fixes: #9286
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10309 from mobash-rasool/pim6-merge
David Lamparter [Mon, 10 Jan 2022 09:07:56 +0000 (10:07 +0100)]
Merge pull request #10309 from mobash-rasool/pim6-merge

2 years agopimd: API changes to accomodate IPv4 and IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:15:23 +0000 (22:15 -0800)]
pimd: API changes to accomodate IPv4 and IPv6

Added apis which will be decided on compile time
for pimd and pim6d daemon
Reviewed-by: Sarita Patra <saritap@vmware.com>
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agodoc: Adding the Design document for PIM IPv6
Mobashshera Rasool [Wed, 8 Dec 2021 15:11:51 +0000 (07:11 -0800)]
doc: Adding the Design document for PIM IPv6

Added the High Level design for implementing MLD and PIMv6.

Added a PPT as well in case someone wants to translate it
to some other language.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agopimd: Adding pim_addr as common address for IPv4 and IPv6
Mobashshera Rasool [Tue, 14 Dec 2021 06:10:29 +0000 (22:10 -0800)]
pimd: Adding pim_addr as common address for IPv4 and IPv6

PIM_ADDR will be controlled at compile time for IPv4 and IPv6.
in_addr and in6_addr will be compiled for the respective daemons.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agoMerge pull request #10030 from anlancs/cleanup-reload-null0
Igor Ryzhov [Sun, 9 Jan 2022 14:17:00 +0000 (17:17 +0300)]
Merge pull request #10030 from anlancs/cleanup-reload-null0

tools: cleanup convertion of "Null0"

2 years agoMerge pull request #9517 from anlancs/reload-add-str
Jafar Al-Gharaibeh [Sun, 9 Jan 2022 06:07:53 +0000 (00:07 -0600)]
Merge pull request #9517 from anlancs/reload-add-str

tools: fix wrong get_contexts() of Config class.

2 years agoMerge pull request #10191 from iqras23/bgp_gr
Donatas Abraitis [Sat, 8 Jan 2022 21:07:45 +0000 (23:07 +0200)]
Merge pull request #10191 from iqras23/bgp_gr

bgpd: VRF-Lite fix to clear stale leaked routes

2 years agotests: BGP : Dynamic route leak VRF lite (BGP-GR)
ARShreenidhi [Tue, 14 Dec 2021 05:52:03 +0000 (21:52 -0800)]
tests: BGP : Dynamic route leak VRF lite (BGP-GR)

Authored-by: Shreenidhi A R <rshreenidhi@vmware.com>
Signed-off-by: Shreenidhi A R <rshreenidhi@vmware.com>
2 years agobgpd: VRF-Lite fix to clear stale leaked routes
Kantesh Mundaragi [Fri, 19 Feb 2021 04:48:41 +0000 (20:48 -0800)]
bgpd: VRF-Lite fix to clear stale leaked routes

Description:
Change is intended for fixing the issue related to
clearing of stale leaked routes:
- Whenever BGP goes down,
  after bringing down tcp connection and renegotiating capabilities,
  once we reestablish connection,
  we are not handling clear of VRF leaked route in the bgp_clear_stale_route.

- While bgp is clearing stale routes,
  we need to handle withdraw of routes for VRF route-leaking.

Co-authored-by: Kantesh Mundaragi <kmundaragi@vmware.com>
Signed-off-by: Iqra Siddiqui <imujeebsiddi@vmware.com>
2 years agoMerge pull request #10288 from ton31337/fix/rfc7300
Donald Sharp [Sat, 8 Jan 2022 13:42:19 +0000 (08:42 -0500)]
Merge pull request #10288 from ton31337/fix/rfc7300

bgpd: Add a warning if we try to use the last reserved ASN

2 years agoMerge pull request #10289 from ton31337/fix/rfc9003
Donald Sharp [Sat, 8 Jan 2022 13:17:25 +0000 (08:17 -0500)]
Merge pull request #10289 from ton31337/fix/rfc9003

bgpd: Extended BGP Administrative Shutdown Communication

2 years agoMerge pull request #10306 from anlancs/bfd-debug-info
Donald Sharp [Sat, 8 Jan 2022 13:09:17 +0000 (08:09 -0500)]
Merge pull request #10306 from anlancs/bfd-debug-info

lib: small debug adjustment for bfd

2 years agoMerge pull request #10242 from anlancs/fix-service-time
Donald Sharp [Sat, 8 Jan 2022 12:15:37 +0000 (07:15 -0500)]
Merge pull request #10242 from anlancs/fix-service-time

build: add "--with-service-timeout" in configure.ac

2 years agopimd: Cleanup weird indentation
Donald Sharp [Thu, 6 Jan 2022 12:30:09 +0000 (07:30 -0500)]
pimd: Cleanup weird indentation

The zlog_warn used to be bounded by a debug guard
but the debug guard was removed but the code was
never fixed up to remove the open and close paranthesis.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobfdd: Clean up some white space snafu's
Donald Sharp [Wed, 5 Jan 2022 21:11:52 +0000 (16:11 -0500)]
bfdd: Clean up some white space snafu's

Found some extra spaces during code inspection.  Let's
get them cleaned up.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10305 from mobash-rasool/minor-fixes
Donald Sharp [Sat, 8 Jan 2022 12:08:59 +0000 (07:08 -0500)]
Merge pull request #10305 from mobash-rasool/minor-fixes

pimd: remove redundant header inclusion

2 years agolib: small debug adjustment for bfd
anlan_cs [Sat, 8 Jan 2022 10:45:59 +0000 (05:45 -0500)]
lib: small debug adjustment for bfd

Just use `__func__` to display function name.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agopimd: remove redundant header inclusion
Mobashshera Rasool [Sat, 8 Jan 2022 07:21:00 +0000 (23:21 -0800)]
pimd: remove redundant header inclusion

Just found while code inspection, pim_str.h is included twice.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2 years agotests: Adopt bgp_shutdown_message test to a proper encoding
Donatas Abraitis [Thu, 6 Jan 2022 09:08:17 +0000 (11:08 +0200)]
tests: Adopt bgp_shutdown_message test to a proper encoding

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: Add rfc9003 to supported BGP RFCs
Donatas Abraitis [Wed, 5 Jan 2022 13:29:00 +0000 (15:29 +0200)]
doc: Add rfc9003 to supported BGP RFCs

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Use correct encoding before printing shutdown msg
Donatas Abraitis [Wed, 5 Jan 2022 13:05:04 +0000 (15:05 +0200)]
bgpd: Use correct encoding before printing shutdown msg

Using `bgp shutdown message MSG...`.

Length should be decoded from the first byte, but it's decoded from the data
instead.

Before:

```
%NOTIFICATION: sent to neighbor 192.168.0.2 6/2 (Cease/Administratively Shutdown) 70 bytes 5b 54 49 43 4b 45 54 2d 31 2d 31 34 33 38 33 36 37 33 39 30 5d 20 73
```

After:

```
%NOTIFICATION: sent to neighbor 192.168.0.2 6/2 (Cease/Administratively Shutdown) "[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;"
```

On receiving side:

```
"[TICKET-1-1438367390] software upgrade; Expected downtime for 2 hours;"
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Limit shutdown message size to max 255 characters
Donatas Abraitis [Wed, 5 Jan 2022 13:00:31 +0000 (15:00 +0200)]
bgpd: Limit shutdown message size to max 255 characters

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Increase administrative shutdown message size to 255
Donatas Abraitis [Wed, 5 Jan 2022 10:11:27 +0000 (12:11 +0200)]
bgpd: Increase administrative shutdown message size to 255

Extended BGP Administrative Shutdown Communication (rfc9003):

Basically, shutdown message size is increased to 255 from 128.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Add a warning if we try to use the last reserved ASN
Donatas Abraitis [Wed, 5 Jan 2022 09:42:52 +0000 (11:42 +0200)]
bgpd: Add a warning if we try to use the last reserved ASN

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10301 from donaldsharp/pim_multicast_fix
Jafar Al-Gharaibeh [Fri, 7 Jan 2022 20:18:08 +0000 (14:18 -0600)]
Merge pull request #10301 from donaldsharp/pim_multicast_fix

tools: Give longer for interface traffic in pim to work

2 years agoMerge pull request #10290 from donaldsharp/nhrp_topo_queries
Jafar Al-Gharaibeh [Fri, 7 Jan 2022 20:00:50 +0000 (14:00 -0600)]
Merge pull request #10290 from donaldsharp/nhrp_topo_queries

Nhrp topo queries

2 years agoMerge pull request #10300 from donaldsharp/support_bundle_fix
Jafar Al-Gharaibeh [Fri, 7 Jan 2022 19:13:14 +0000 (13:13 -0600)]
Merge pull request #10300 from donaldsharp/support_bundle_fix

tools: Run formatter over generate_support_bundle.py

2 years agotests: Ensure packets have a chance to arrive in test_multicast_pim_sm_topo4.py
Donald Sharp [Fri, 7 Jan 2022 14:15:19 +0000 (09:15 -0500)]
tests: Ensure packets have a chance to arrive in test_multicast_pim_sm_topo4.py

The test is doing this:

a) gather interface data about packets sent
b) shut interface
c) no shut interface
d) gather interface data about packets sent
e) compare a to d and fail if packets sent/received has not incremented

The problem is, of course, that under heavy system load insufficient time
might not have passed for packets to be sent between c and d.  Add up to
35 seconds of looking for packet data being incremented else heavily
loaded systems may never show that data is being sent.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotest: Cleanup via black the test_multicast_pim_sm_topo4.py
Donald Sharp [Fri, 7 Jan 2022 12:58:29 +0000 (07:58 -0500)]
test: Cleanup via black the test_multicast_pim_sm_topo4.py

The test needed some cleanup via black formatting.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: Rename poorly named function
Donald Sharp [Fri, 7 Jan 2022 12:57:41 +0000 (07:57 -0500)]
tests: Rename poorly named function

verify_pim_interface_traffic *fetches* the pim
traffic data.  Rename the function to what it
actually does

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10286 from ton31337/fix/rfc6938
Mark Stapp [Thu, 6 Jan 2022 17:18:30 +0000 (12:18 -0500)]
Merge pull request #10286 from ton31337/fix/rfc6938

bgpd: Deprecate DPA, ADVERTISER and RCID_PATH path attributes

2 years agobgpd: Deprecate DPA, ADVERTISER and RCID_PATH path attributes
Donatas Abraitis [Wed, 5 Jan 2022 09:02:01 +0000 (11:02 +0200)]
bgpd: Deprecate DPA, ADVERTISER and RCID_PATH path attributes

rfc6938

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10283 from sworleys/Alpline-Git-Rev
Donatas Abraitis [Thu, 6 Jan 2022 13:37:34 +0000 (15:37 +0200)]
Merge pull request #10283 from sworleys/Alpline-Git-Rev

docker: update alpine build enable set own version

2 years agotools: Run formatter over generate_support_bundle.py
Donald Sharp [Thu, 6 Jan 2022 13:18:30 +0000 (08:18 -0500)]
tools: Run formatter over generate_support_bundle.py

The generate_support_bundle.py script needs some
reformating to meet our standards

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10226 from bisdn/jogo_fix_support_bundle_backup
Donald Sharp [Thu, 6 Jan 2022 13:17:12 +0000 (08:17 -0500)]
Merge pull request #10226 from bisdn/jogo_fix_support_bundle_backup

tools: fix backing up previous logs in generate_support_bundle.py

2 years agoMerge pull request #10284 from ton31337/fix/adjust_rfc4486
Donald Sharp [Thu, 6 Jan 2022 12:49:00 +0000 (07:49 -0500)]
Merge pull request #10284 from ton31337/fix/adjust_rfc4486

bgpd: Adjust symbolic names for cease notifications according to rfc4486

2 years agobuild: add "--with-service-timeout" in configure.ac
anlan_cs [Thu, 30 Dec 2021 05:17:05 +0000 (00:17 -0500)]
build: add "--with-service-timeout" in configure.ac

On lower CPU with lots of static routes, it will cost more than 2
minutes.

2 minutes is the default timeout value, we can adjust it by configure:
./configure --with-service-timeout=<digit>

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10287 from ton31337/fix/rfc7196
Donald Sharp [Thu, 6 Jan 2022 12:34:45 +0000 (07:34 -0500)]
Merge pull request #10287 from ton31337/fix/rfc7196

bgpd: Increase maximum supress threshold for dampening to 50,000

2 years agotests: Fixup output that was incorrect in nhrp_topo
Donald Sharp [Wed, 5 Jan 2022 14:15:26 +0000 (09:15 -0500)]
tests: Fixup output that was incorrect in nhrp_topo

The nhrp_topo test sets up some infrastructure and
was displaying the commands it was outputting
incorrectly.  Fix this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #10296 from anlancs/fix-doc-version
Donald Sharp [Thu, 6 Jan 2022 12:26:28 +0000 (07:26 -0500)]
Merge pull request #10296 from anlancs/fix-doc-version

doc: minor grammar correction

2 years agoMerge pull request #10297 from ton31337/fix/gr_can_be_0
Donald Sharp [Thu, 6 Jan 2022 12:26:03 +0000 (07:26 -0500)]
Merge pull request #10297 from ton31337/fix/gr_can_be_0

bgpd: Graceful Restart restart-time can be 0

2 years agobgpd: Graceful Restart restart-time can be 0
Donatas Abraitis [Thu, 6 Jan 2022 09:24:48 +0000 (11:24 +0200)]
bgpd: Graceful Restart restart-time can be 0

Using with LLGR, this should be allowed setting GR restart-time timer to 0,
to immediately start LLGR timers.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agodoc: minor grammar correction
anlan_cs [Thu, 6 Jan 2022 08:28:27 +0000 (03:28 -0500)]
doc: minor grammar correction

Need one empty line.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10291 from mjstapp/fix_topo_doc_reqs
Donatas Abraitis [Thu, 6 Jan 2022 08:14:32 +0000 (10:14 +0200)]
Merge pull request #10291 from mjstapp/fix_topo_doc_reqs

docs: clarify topotest requirements

2 years agobgpd: Increase maximum supress threshold for dampening to 50,000
Donatas Abraitis [Wed, 5 Jan 2022 09:30:38 +0000 (11:30 +0200)]
bgpd: Increase maximum supress threshold for dampening to 50,000

rfc7196 recommends:

In addition, BGP implementations have an internal constant, which we
   will call the 'maximum penalty', and the current computed penalty may
   not exceed it.

Router Maximum Penalty:  The internal constant for the maximum
      penalty value MUST be raised to at least 50,000.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Adjust symbolic names for cease notifications according to rfc4486
Donatas Abraitis [Wed, 5 Jan 2022 07:39:44 +0000 (09:39 +0200)]
bgpd: Adjust symbolic names for cease notifications according to rfc4486

The following subcodes are defined for the Cease NOTIFICATION
   message:

      Subcode     Symbolic Name

         1        Maximum Number of Prefixes Reached
         2        Administrative Shutdown
         3        Peer De-configured
         4        Administrative Reset
         5        Connection Rejected
         6        Other Configuration Change
         7        Connection Collision Resolution
         8        Out of Resources

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10294 from opensourcerouting/topotests-nhrp-require-5.0
Christian Hopps [Thu, 6 Jan 2022 03:25:07 +0000 (22:25 -0500)]
Merge pull request #10294 from opensourcerouting/topotests-nhrp-require-5.0

topotests: require Linux 5.0 for NHRP

2 years agotopotests: require Linux 5.0 for NHRP
David Lamparter [Wed, 5 Jan 2022 19:59:38 +0000 (20:59 +0100)]
topotests: require Linux 5.0 for NHRP

It fails on 4.19, so let's go minimum 5.0 for the time being.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agodocs: clarify topotest requirements
Mark Stapp [Wed, 5 Jan 2022 15:27:17 +0000 (10:27 -0500)]
docs: clarify topotest requirements

The developer docs weren't clear about some pre-reqs.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #10208 from adrianomarto/master
Russ White [Wed, 5 Jan 2022 15:10:23 +0000 (10:10 -0500)]
Merge pull request #10208 from adrianomarto/master

Babel configuration parameter fixes

2 years agoMerge pull request #10260 from ton31337/feature/bgp_llgr_helper_mode
Russ White [Wed, 5 Jan 2022 15:08:31 +0000 (10:08 -0500)]
Merge pull request #10260 from ton31337/feature/bgp_llgr_helper_mode

bgpd: Implement LLGR helper mode

2 years agodocker: update alpine build enable set own version
Stephen Worley [Tue, 4 Jan 2022 18:14:51 +0000 (13:14 -0500)]
docker: update alpine build enable set own version

Add ability to set your own env for the version of the docker
container alpine image. This is useful for applications like GNS3
who pin a specific version to look for when they boot up. When you build
locally to test your code you can just set the version to 0 so you don't
have to update configs/scripts looking for a specific image version.

Also fix a shebang in docker start for alpine.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agoMerge pull request #10274 from anlancs/fix-spell-error-bfd
Donald Sharp [Sun, 2 Jan 2022 22:57:46 +0000 (17:57 -0500)]
Merge pull request #10274 from anlancs/fix-spell-error-bfd

bfdd: correct one spelling error of comment

2 years agobfdd: correct one spelling error of comment
anlan_cs [Fri, 31 Dec 2021 10:30:52 +0000 (05:30 -0500)]
bfdd: correct one spelling error of comment

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agotools: cleanup route convertion from null0/Null0 to blackhole
anlan_cs [Fri, 31 Dec 2021 05:58:52 +0000 (00:58 -0500)]
tools: cleanup route convertion from null0/Null0 to blackhole

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agoMerge pull request #10219 from donaldsharp/l3vpn_to_bgp_vrf_fixes
Russ White [Thu, 30 Dec 2021 23:42:21 +0000 (18:42 -0500)]
Merge pull request #10219 from donaldsharp/l3vpn_to_bgp_vrf_fixes

tests: Further fix bgp_l3vpn_to_bgp_vrf

2 years agotests: Add basic BGP Long-lived Graceful restart tests
Donatas Abraitis [Tue, 28 Dec 2021 10:23:26 +0000 (12:23 +0200)]
tests: Add basic BGP Long-lived Graceful restart tests

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Change default long-lived graceful restart stale timer to 0 seconds
Donatas Abraitis [Thu, 23 Dec 2021 12:23:48 +0000 (14:23 +0200)]
bgpd: Change default long-lived graceful restart stale timer to 0 seconds

That means the feature is off by default.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agobgpd: Implement LLGR helper mode
Donatas Abraitis [Mon, 20 Dec 2021 21:03:09 +0000 (23:03 +0200)]
bgpd: Implement LLGR helper mode

Tested between GoBGP and FRR (this commit).

```
┌───────────┐             ┌────────────┐
│           │             │            │
│ GoBGPD    │             │ FRRouting  │
│ (restart) │             │            │
│           │             │            │
└──────┬────┘             └───────┬────┘
       │                          │
       │                          │
       │                          │
       │     ┌───────────┐        │
       │     │           │        │
       │     │           │        │
       └─────┤ FRRouting ├────────┘
             │ (helper)  │
             │           │
             └───────────┘

// GoBGPD
% cat /etc/gobgp/config.toml
[global.config]
    as = 65002
    router-id = "2.2.2.2"
    port = 179

[[neighbors]]
    [neighbors.config]
        peer-as = 65001
        neighbor-address = "2a02:abc::123"
    [neighbors.graceful-restart.config]
        enabled = true
        restart-time = 3
        long-lived-enabled = true
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv6-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 10
    [[neighbors.afi-safis]]
        [neighbors.afi-safis.config]
            afi-safi-name = "ipv4-unicast"
        [neighbors.afi-safis.mp-graceful-restart.config]
            enabled = true
        [neighbors.afi-safis.long-lived-graceful-restart.config]
            enabled = true
            restart-time = 20

% ./gobgp global rib add -a ipv6 2001:db8:4::/64
% ./gobgp global rib add -a ipv6 2001:db8:5::/64 community 65535:7
% ./gobgp global rib add -a ipv4 100.100.100.100/32
% ./gobgp global rib add -a ipv4 100.100.100.200/32 community 65535:7
```

1. When killing GoBGPD, graceful restart timer starts in FRR helper router;
2. When GR timer expires in helper router:
   a) LLGR_STALE community is attached to routes to be retained;
   b) Clear stale routes that have NO_LLGR community attached;
   c) Start LLGR timer per AFI/SAFI;
   d) Recompute bestpath and reannounce routes to peers;
   d) When LLGR timer expires, clear all routes on particular AFI/SAFI.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10254 from ton31337/fix/typo
Donald Sharp [Mon, 27 Dec 2021 13:21:49 +0000 (08:21 -0500)]
Merge pull request #10254 from ton31337/fix/typo

bgpd: Fix typo in bgp_aggr_community_hash_alloc()

2 years agoMerge pull request #10261 from ton31337/fix/remove_if0
Igor Ryzhov [Thu, 23 Dec 2021 22:09:41 +0000 (01:09 +0300)]
Merge pull request #10261 from ton31337/fix/remove_if0

2 years agoMerge pull request #10259 from anlancs/add-assert-ospf6
Donatas Abraitis [Thu, 23 Dec 2021 12:50:47 +0000 (14:50 +0200)]
Merge pull request #10259 from anlancs/add-assert-ospf6

ospf6d: clean coverity warning of possible null pointer

2 years agobgpd: Drop `if 0` blocks
Donatas Abraitis [Thu, 23 Dec 2021 12:41:11 +0000 (14:41 +0200)]
bgpd: Drop `if 0` blocks

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2 years agoMerge pull request #10256 from anlancs/cleanup-zebra_evpn_mac_add
Igor Ryzhov [Thu, 23 Dec 2021 10:10:18 +0000 (13:10 +0300)]
Merge pull request #10256 from anlancs/cleanup-zebra_evpn_mac_add

zebra: cleanup checking zebra_evpn_mac_add function's return value

2 years agoospf6d: clean coverity warning of possible null pointer
anlan_cs [Thu, 23 Dec 2021 02:51:55 +0000 (21:51 -0500)]
ospf6d: clean coverity warning of possible null pointer

Add assert to protect it.

Signed-off-by: anlan_cs <anlan_cs@tom.com>
2 years agozebra: cleanup checking zebra_evpn_mac_add function's return value
anlan_cs [Wed, 22 Dec 2021 01:03:36 +0000 (20:03 -0500)]
zebra: cleanup checking zebra_evpn_mac_add function's return value

This function is sure to return correct value by "assert", so the
checking its return value should be removed.

Signed-off-by: anlan_cs <anlan_cs@tom.com>