]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 years agoMerge pull request #12828 from FRRouting/mergify/bp/dev/8.5/pr-12734
Igor Ryzhov [Fri, 17 Feb 2023 10:10:18 +0000 (12:10 +0200)]
Merge pull request #12828 from FRRouting/mergify/bp/dev/8.5/pr-12734

lib: Fix non-use of option (backport #12734)

2 years agolib: Fix non-use of option 12828/head
Donald Sharp [Thu, 2 Feb 2023 21:28:27 +0000 (16:28 -0500)]
lib: Fix non-use of option

Commit d7c6467ba2f55d1055babbb7fe82716ca3efdc7e added the
ability to specify non pretty printing but unfortunately
forgot to use the option variable to make the whole
thing work.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 00b0bb99ae9fb6cd003d3e38c4760d1fd59ab545)

2 years agoMerge pull request #12803 from FRRouting/mergify/bp/dev/8.5/pr-12790
Donald Sharp [Tue, 14 Feb 2023 20:19:28 +0000 (15:19 -0500)]
Merge pull request #12803 from FRRouting/mergify/bp/dev/8.5/pr-12790

vrrpd: give null when using null ifp to lookup vr (backport #12790)

2 years agovrrpd: give null when using null ifp to lookup vr 12803/head
Quentin Young [Mon, 28 Oct 2019 15:41:38 +0000 (15:41 +0000)]
vrrpd: give null when using null ifp to lookup vr

This is still causing crashes somehow.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
(cherry picked from commit ed331629de425914568c1d5c114018878627cdaf)

2 years agoMerge pull request #12788 from FRRouting/mergify/bp/dev/8.5/pr-12776
Jafar Al-Gharaibeh [Fri, 10 Feb 2023 16:59:19 +0000 (10:59 -0600)]
Merge pull request #12788 from FRRouting/mergify/bp/dev/8.5/pr-12776

pim6d: Modify "show ipv6 mld join json" o/p (backport #12776)

2 years agopim6d: Modify "show ipv6 mld join json" o/p 12788/head
Sarita Patra [Thu, 9 Feb 2023 07:38:18 +0000 (23:38 -0800)]
pim6d: Modify "show ipv6 mld join json" o/p

Currently "show ipv6 mld join json" o/p is
frr# show ipv6 mld joins json
{
  "default":{
    "ens192":{
      "ff02:2":{
        "::":{
          "state":"JOIN",
          "created":"00:01:50.595",
          "lastSeen":"00:00:38.403",
        }
      }
    }
  }
}

Here, I modified the o/p as below for better understanding.
frr# show ipv6 mld joins json
{
  "default":{
    "vrf":"default",
    "ens192":{
      "ff02::2":{
        "*":{
          "state":"JOIN",
          "created":"00:00:42.766",
          "lastSeen":"00:00:05.266"
        }
      }
    }
  }
}

Issue: #12755

Signed-off-by: Sarita Patra <saritap@vmware.com>
(cherry picked from commit 58971e1574911fd5bd4f6385c2fa93c999e33604)

2 years agoMerge pull request #12784 from FRRouting/mergify/bp/dev/8.5/pr-12781
Donatas Abraitis [Fri, 10 Feb 2023 08:41:11 +0000 (10:41 +0200)]
Merge pull request #12784 from FRRouting/mergify/bp/dev/8.5/pr-12781

lib: Release memory of YANG translation module on error (backport #12781)

2 years agoMerge pull request #12786 from FRRouting/mergify/bp/dev/8.5/pr-12782
Donatas Abraitis [Fri, 10 Feb 2023 04:42:06 +0000 (06:42 +0200)]
Merge pull request #12786 from FRRouting/mergify/bp/dev/8.5/pr-12782

bgpd: Intern default-originate attributes to avoid use-after-free (backport #12782)

2 years agotests: Check if BGP default-originate withdraw works correctly 12786/head
Donatas Abraitis [Thu, 9 Feb 2023 20:55:53 +0000 (22:55 +0200)]
tests: Check if BGP default-originate withdraw works correctly

And also do not crash when we do `clear ip bgp ...`.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 35b7ce08a81cfa8b55bd5160008e36d83cb8b791)

2 years agobgpd: Intern default-originate attributes to avoid use-after-free
Donatas Abraitis [Thu, 9 Feb 2023 20:29:25 +0000 (22:29 +0200)]
bgpd: Intern default-originate attributes to avoid use-after-free

When we receive a default route from a peer and we originate default route
using `neighbor default-originate`, we do not track of struct attr we use,
and when we do `no neighbor default-originate` we withdraw our generated
default route, but we announce default-route from the peer.

After we do this, we unintern aspath (which was used for default-originate),
BUT it was used also for peer's default route we received.

And here we have a use-after-free crash, because bgp_process_main_one()
reaps old paths that are marked as BGP_PATH_REMOVED with aspath->refcnt > 0,
but here it's 0.

```
0 0x55c24bbcd022 in aspath_key_make bgpd/bgp_aspath.c:2070
1 0x55c24b8f1140 in attrhash_key_make bgpd/bgp_attr.c:777
2 0x7f52322e66c9 in hash_release lib/hash.c:220
3 0x55c24b8f6017 in bgp_attr_unintern bgpd/bgp_attr.c:1271
4 0x55c24ba0acaa in bgp_path_info_free_with_caller bgpd/bgp_route.c:283
5 0x55c24ba0a7de in bgp_path_info_unlock bgpd/bgp_route.c:309
6 0x55c24ba0af6d in bgp_path_info_reap bgpd/bgp_route.c:426
7 0x55c24ba17b9a in bgp_process_main_one bgpd/bgp_route.c:3333
8 0x55c24ba18a1d in bgp_process_wq bgpd/bgp_route.c:3425
9 0x7f52323c2cd5 in work_queue_run lib/workqueue.c:282
10 0x7f52323aab92 in thread_call lib/thread.c:2006
11 0x7f5232300dc7 in frr_run lib/libfrr.c:1198
12 0x55c24b8ea792 in main bgpd/bgp_main.c:520
13 0x7f5231c3a082 in __libc_start_main ../csu/libc-start.c:308
14 0x55c24b8ef0bd in _start (/usr/lib/frr/bgpd+0x2c90bd)
    ```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit e9340ff429f5f1a255e89a50867a04a370cd56bb)

2 years agolib: Free dnode before returning if YANG translator model is already loaded 12784/head
Donatas Abraitis [Thu, 9 Feb 2023 21:14:46 +0000 (23:14 +0200)]
lib: Free dnode before returning if YANG translator model is already loaded

Seems just a missed one because at `goto error` we release dnode.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit ecf82aa41e76ecfbaf3f5762af1e90ebc9263721)

2 years agolib: Release memory of YANG translation module on error
Donatas Abraitis [Thu, 9 Feb 2023 15:59:11 +0000 (17:59 +0200)]
lib: Release memory of YANG translation module on error

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit b9941b3fec21eca413c4ca9460a264eb9afb7e34)

2 years agoMerge pull request #12778 from FRRouting/mergify/bp/dev/8.5/pr-12773
Donatas Abraitis [Thu, 9 Feb 2023 13:19:28 +0000 (15:19 +0200)]
Merge pull request #12778 from FRRouting/mergify/bp/dev/8.5/pr-12773

pbrd: fix large tableids displayed as negative (backport #12773)

2 years agopbrd: fix large tableids displayed as negative 12778/head
Wesley Coakley [Tue, 20 Jul 2021 13:25:01 +0000 (09:25 -0400)]
pbrd: fix large tableids displayed as negative

Ticket: 2699411
Signed-off-by: Wesley Coakley <wcoakley@nvidia.com>
(cherry picked from commit 8dc2001c914956f1b493c4e04499b520362dd053)

2 years agoMerge pull request #12770 from FRRouting/mergify/bp/dev/8.5/pr-12768
Donatas Abraitis [Thu, 9 Feb 2023 07:47:20 +0000 (09:47 +0200)]
Merge pull request #12770 from FRRouting/mergify/bp/dev/8.5/pr-12768

tests: do not use exclude grep (backport #12768)

2 years agoMerge pull request #12771 from FRRouting/mergify/bp/dev/8.5/pr-12769
Donald Sharp [Thu, 9 Feb 2023 01:15:49 +0000 (20:15 -0500)]
Merge pull request #12771 from FRRouting/mergify/bp/dev/8.5/pr-12769

tools: Fix missing pbrd in rsyslog.d 45-frr.conf file (backport #12769)

2 years agotools: Fix missing pbrd in rsyslog.d 45-frr.conf file 12771/head
Donald Sharp [Wed, 8 Feb 2023 18:04:01 +0000 (13:04 -0500)]
tools: Fix missing pbrd in rsyslog.d 45-frr.conf file

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 7386031781858b3a43bc66484b53d57be3ee28e8)

2 years agotests: do not use exclude grep 12770/head
Louis Scalbert [Wed, 8 Feb 2023 11:05:15 +0000 (12:05 +0100)]
tests: do not use exclude grep

Filter out keys in JSON output with "grep -v" does not work when JSON
does not use the pretty format.

Use native python code to filter out keys.

Fixes: 6c13bd5744 ("topotests: fix bgp_vpnv4_noretain")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
(cherry picked from commit a8d6faa9864c78f8570c8ac89c78d3095c43532d)

2 years agoMerge pull request #12765 from FRRouting/mergify/bp/dev/8.5/pr-12761
Donatas Abraitis [Wed, 8 Feb 2023 11:54:29 +0000 (13:54 +0200)]
Merge pull request #12765 from FRRouting/mergify/bp/dev/8.5/pr-12761

bgpd: fix use-after-free crash for evpn (backport #12761)

2 years agobgpd: fix use-after-free crash for evpn 12765/head
anlan_cs [Mon, 6 Feb 2023 01:27:05 +0000 (09:27 +0800)]
bgpd: fix use-after-free crash for evpn

```
anlan(config-router-af)# vni 33
anlan(config-router-af-vni)# route-target both 44:55
anlan(config-router-af-vni)# no route-target both 44:55
vtysh: error reading from bgpd: Resource temporarily unavailable (11)Warning: closing connection to bgpd because of an I/O error!
```

When `bgp_evpn_vni_rt_cmd` deals with "both" type, it wrongly created
only one node ( should be two nodes ) for lists of both `vpn->import_rtl` and
`vpn->export_rtl`.  At this time, the two lists are already wrong.

In `no route-target both RT`, it will free the single node from lists of both
`vpn->import_rtl` and `vpn->export_rtl`.  After freed from `vpn->import_rtl`,
it is "use-after-free" at the time of freeing it from `vpn->export_rtl`.
It causes crash sometimes, or other unexpected behaviours.

This issue is introduced by commit `3b7e8d`, which have adjusted both
`bgp_evpn_vni_rt_cmd` and `bgp_evpn_vrf_rt_cmd`.

Since `bgp_evpn_vrf_rt_cmd/no_bgp_evpn_vrf_rt_cmd` works well again
unintentionally with commit `7022da`, only `bgp_evpn_vni_rt_cmd` needs to
modify - add two nodes for "both" type and some explicit comments for this
special case of "both" type.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
(cherry picked from commit 432ff4b036860fb626f3027a7798038d594b8042)

2 years agoMerge pull request #12722 from opensourcerouting/vim-xref base_8.5
Jafar Al-Gharaibeh [Tue, 7 Feb 2023 16:43:27 +0000 (10:43 -0600)]
Merge pull request #12722 from opensourcerouting/vim-xref

tools: add `GotoXref` vim script

2 years agoMerge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_...
Jafar Al-Gharaibeh [Tue, 7 Feb 2023 16:42:53 +0000 (10:42 -0600)]
Merge pull request #12715 from opensourcerouting/fix/contribution_guid_squash_random_commits

Commits hygiene

2 years agoMerge pull request #12748 from opensourcerouting/fix/route_map_vpn_import
Russ White [Tue, 7 Feb 2023 16:40:03 +0000 (11:40 -0500)]
Merge pull request #12748 from opensourcerouting/fix/route_map_vpn_import

tests: Check if route-map vpn import basic funtionality works fine

2 years agoMerge pull request #12720 from opensourcerouting/fix/ecommunity_ipv6_missing_token
Russ White [Tue, 7 Feb 2023 14:21:07 +0000 (09:21 -0500)]
Merge pull request #12720 from opensourcerouting/fix/ecommunity_ipv6_missing_token

bgpd: ecommunity_token_rt6 is not handled

2 years agoMerge pull request #12741 from thesamesam/missing-time
Donatas Abraitis [Tue, 7 Feb 2023 09:05:46 +0000 (11:05 +0200)]
Merge pull request #12741 from thesamesam/missing-time

pceplib: add <time.h> include for time_t

2 years agopceplib: add <time.h> include for time_t 12741/head
Sam James [Sat, 4 Feb 2023 23:29:59 +0000 (23:29 +0000)]
pceplib: add <time.h> include for time_t

Fixes build on musl. Used for time_t in the header.

Bug: https://bugs.gentoo.org/862558
Signed-off-by: Sam James <sam@gentoo.org>
2 years agobgpd: Add more context in logs about from where to where routes are leaked 12748/head
Donatas Abraitis [Mon, 6 Feb 2023 16:41:19 +0000 (18:41 +0200)]
bgpd: Add more context in logs about from where to where routes are leaked

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Drop struct bgp from vpn_leak_to_vrf_withdraw()
Donatas Abraitis [Mon, 6 Feb 2023 16:40:44 +0000 (18:40 +0200)]
bgpd: Drop struct bgp from vpn_leak_to_vrf_withdraw()

Not used at all, just drop it.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotests: Check if `route-map vpn import` basic funtionality works fine
Donatas Abraitis [Mon, 6 Feb 2023 16:38:52 +0000 (18:38 +0200)]
tests: Check if `route-map vpn import` basic funtionality works fine

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12740 from vfreex/babel-fix-filtering
Donatas Abraitis [Mon, 6 Feb 2023 13:24:56 +0000 (15:24 +0200)]
Merge pull request #12740 from vfreex/babel-fix-filtering

babeld: Fix filtering against all interfaces

2 years agobabeld: Fix filtering against all interfaces 12740/head
Yuxiang Zhu [Sat, 4 Feb 2023 17:20:43 +0000 (17:20 +0000)]
babeld: Fix filtering against all interfaces

The first argument of `access_list_lookup` and `prefix_list_lookup`
should be `AFI_` constants instead of `AF_` constants.

Signed-off-by: Yuxiang Zhu <vfreex@gmail.com>
2 years agoMerge pull request #12668 from anlancs/fix/zebra-evpn-missing-advertise
Donatas Abraitis [Sat, 4 Feb 2023 10:52:22 +0000 (12:52 +0200)]
Merge pull request #12668 from anlancs/fix/zebra-evpn-missing-advertise

zebra: fix wrong conversion for evpn advertising

2 years agoMerge pull request #12732 from donaldsharp/fix_bgp_open_issues
Mark Stapp [Fri, 3 Feb 2023 12:17:00 +0000 (07:17 -0500)]
Merge pull request #12732 from donaldsharp/fix_bgp_open_issues

bgpd: Don't try to recursively hold peer io mutex

2 years agobgpd: Don't try to recursively hold peer io mutex 12732/head
Donald Sharp [Thu, 2 Feb 2023 19:13:12 +0000 (14:13 -0500)]
bgpd: Don't try to recursively hold peer io mutex

BGP was modified in a0b937de428e14e869b8541f0b7810113d619c2e
to grab the peer->io_mtx before validating the header to ensure
that the input Queue was not being modified by anyone else at that
moment in time.  Unfortunately validate_header can detect a problem
and attempt to relock the mutex, which deadlocks.  This deadlock in
the bgp_io pthread is the lone deadlock at first, eventually though
bgp attempts to write another packet to the peer( say when the
it's time to send the next packet ) and the main pthread of bgpd
becomes deadlocked and then the whole bgpd process is stuck at that
point in time leaving us dead in the water.

The point of locking the mutex earlier was to ensure that the input
Queue wasn't being modified by anyone else, (Say reading off it )
as that we wanted to ensure that we don't hold more packets then necessary.

Let's grab the mutex long enough to look at the input Q size, this
ensure that we have room and then we can validate_header and do the right
thing from there.  We'll need to lock the mutex when we actually move it
into the input Q as well.

Fixes: #12725
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12731 from donaldsharp/remove_pretty_print
Russ White [Thu, 2 Feb 2023 20:44:45 +0000 (15:44 -0500)]
Merge pull request #12731 from donaldsharp/remove_pretty_print

lib, bgpd: Add ability to specify that some json output should not be…

2 years agobgpd: Convert evpn output to not pretty print json 12731/head
Donald Sharp [Thu, 2 Feb 2023 15:40:07 +0000 (10:40 -0500)]
bgpd: Convert evpn output to not pretty print json

Commit: 3cdb03fba7b40240fb38469a12b7b05a11043e09
changed the vty_json output to not be pretty printing.
The previous commit in the tree added vty_json_no_pretty
let's use that instead

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib, bgpd: Add ability to specify that some json output should not be pretty
Donald Sharp [Thu, 2 Feb 2023 15:28:19 +0000 (10:28 -0500)]
lib, bgpd: Add ability to specify that some json output should not be pretty

Initial commit: 23b2a7ef524c9fe083b217c7f6ebaec0effc8f52
changed the json output of `show bgp <afi> <safi> json` to
not have pretty print because when under a situation where
there are a bunch of routes with a large scale ecmp show
output was taking forever and this commit cut 2 minutes out
of vtysh run time.

Subusequent commit: f4ec52f7cc99f709756d9030623a20c98a086125
changed this back.

When upgrading to latest version the long run time was noticed
due to testing.  Let's add back this functionality such that
FRR can have reduced run times with vtysh when it's really
needed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12729 from opensourcerouting/fix/treat-as-withdraw_nlri_update
Donald Sharp [Thu, 2 Feb 2023 13:29:59 +0000 (08:29 -0500)]
Merge pull request #12729 from opensourcerouting/fix/treat-as-withdraw_nlri_update

bgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw

2 years agobgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw 12729/head
Donatas Abraitis [Tue, 24 Jan 2023 08:32:13 +0000 (10:32 +0200)]
bgpd: Set attr to NULL when passing NLRI_UPDATE with treat-as-withdraw

Before this patch, we always passed `struct attr` for NLRI_UPDATE, but if we
have a situation with treat-as-withdraw (for example: malformed attribute, or
using a command like `neighbor path-attribute treat-as-withdraw`) the route
MUST be withdrawn form the BGP table.

Hence, we MUST pass attr as NULL, in this case we already have this check
under NLRI_ATTR_ARG() macro, just reuse it properly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12672 from donaldsharp/remove_insecure
Donatas Abraitis [Wed, 1 Feb 2023 20:45:20 +0000 (22:45 +0200)]
Merge pull request #12672 from donaldsharp/remove_insecure

vtysh: Remove shell access code

2 years agoMerge pull request #12713 from opensourcerouting/fix/json_naming_deprecation
Donald Sharp [Wed, 1 Feb 2023 20:39:18 +0000 (15:39 -0500)]
Merge pull request #12713 from opensourcerouting/fix/json_naming_deprecation

*: Drop deprecated incorrect JSON fields with wrong naming

2 years agoMerge pull request #12721 from opensourcerouting/format-warnings-redux
Christian Hopps [Wed, 1 Feb 2023 16:13:46 +0000 (11:13 -0500)]
Merge pull request #12721 from opensourcerouting/format-warnings-redux

*: more format string fixing

2 years agovtysh: Schedule shell access for deprecation 12672/head
Donald Sharp [Wed, 1 Feb 2023 15:26:41 +0000 (10:26 -0500)]
vtysh: Schedule shell access for deprecation

Schedule shell access for deprecation and removal in
a years time.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agotests: add missing printf attribute 12721/head
David Lamparter [Tue, 31 Jan 2023 21:17:10 +0000 (22:17 +0100)]
tests: add missing printf attribute

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agotests: yank asprintfrr duplicate
David Lamparter [Tue, 31 Jan 2023 21:12:41 +0000 (22:12 +0100)]
tests: yank asprintfrr duplicate

I think this one predates the existence of asprintfrr.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: fix one more b0rked format string
David Lamparter [Tue, 31 Jan 2023 21:05:17 +0000 (22:05 +0100)]
lib: fix one more b0rked format string

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd/rfapi: add missing printf attribute
David Lamparter [Tue, 31 Jan 2023 21:04:39 +0000 (22:04 +0100)]
bgpd/rfapi: add missing printf attribute

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: apply more `printf` attributes
David Lamparter [Tue, 31 Jan 2023 20:58:41 +0000 (21:58 +0100)]
lib: apply more `printf` attributes

... missed some functions in the earlier commits :(

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agotools: add GotoXref vim script 12722/head
David Lamparter [Tue, 31 Jan 2023 22:18:52 +0000 (23:18 +0100)]
tools: add GotoXref vim script

Let's make these unique IDs actually a bit useful.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #12667 from donaldsharp/zebra_rib_fixup
Donatas Abraitis [Tue, 31 Jan 2023 19:41:30 +0000 (21:41 +0200)]
Merge pull request #12667 from donaldsharp/zebra_rib_fixup

tests: zebra_rib remove a sleep

2 years agobgpd: ecommunity_token_rt6 is not handled 12720/head
Donald Sharp [Fri, 27 Jan 2023 13:10:08 +0000 (08:10 -0500)]
bgpd: ecommunity_token_rt6 is not handled

The function ecommunity_str2com_internal appears to want to handle
the ecommunity_token_rt6 enum but skips over it.  Commit
9a659715dfcb6c0b1e3ef8004b6c9d14c55f2081 tried to add this but I really
don't see how this is going to behave correctly.  Add the
ecommunity_token_rt6 case to the switch statement so it is handled
appropriately?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12704 from donaldsharp/pim6_route_map
Donatas Abraitis [Tue, 31 Jan 2023 18:51:45 +0000 (20:51 +0200)]
Merge pull request #12704 from donaldsharp/pim6_route_map

pimd: v6 intentionally turned off route-maps.  Turn it on.

2 years agotests: Use JSON camelCase naming for tests 12713/head
Donatas Abraitis [Tue, 31 Jan 2023 10:47:43 +0000 (12:47 +0200)]
tests: Use JSON camelCase naming for tests

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12686 from opensourcerouting/debian-sync-20230124
Donald Sharp [Tue, 31 Jan 2023 17:37:39 +0000 (12:37 -0500)]
Merge pull request #12686 from opensourcerouting/debian-sync-20230124

debian: synchronize/fold back debian changes

2 years agoMerge pull request #12717 from opensourcerouting/topotest_stop_topo_fix
Donald Sharp [Tue, 31 Jan 2023 17:30:35 +0000 (12:30 -0500)]
Merge pull request #12717 from opensourcerouting/topotest_stop_topo_fix

tests: Fix wrong tgen.stop_topology() calls which got skipped

2 years agoMerge pull request #12687 from opensourcerouting/build-mkdir-p
Mark Stapp [Tue, 31 Jan 2023 16:28:32 +0000 (11:28 -0500)]
Merge pull request #12687 from opensourcerouting/build-mkdir-p

build: consistently mkdir -p output for redirect

2 years agoMerge pull request #12708 from donaldsharp/no_notification
Mark Stapp [Tue, 31 Jan 2023 15:55:01 +0000 (10:55 -0500)]
Merge pull request #12708 from donaldsharp/no_notification

zebra: Send nht resolved entry up to concerned protocols in all cases

2 years agotests: Fix wrong tgen.stop_topology() calls which got skipped 12717/head
Martin Winter [Tue, 31 Jan 2023 15:10:04 +0000 (16:10 +0100)]
tests: Fix wrong tgen.stop_topology() calls which got skipped

Calls were missing the () and caused the stop_topology() to be skipped

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2 years agotests: zebra_rib remove a sleep 12667/head
Donald Sharp [Thu, 19 Jan 2023 20:46:31 +0000 (15:46 -0500)]
tests: zebra_rib remove a sleep

The test was sometimes failing around the sleep(4) for
waiting for the routes to be installed.  Instead of blindly
sleeping let's check to see that the routes are actually
there in zebra and then continue on.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12695 from opensourcerouting/format-warnings
Donald Sharp [Tue, 31 Jan 2023 14:01:32 +0000 (09:01 -0500)]
Merge pull request #12695 from opensourcerouting/format-warnings

build: `-Wformat-nonliteral -Wformat-security`

2 years agoMerge pull request #12710 from opensourcerouting/fix/reset_fqdn_capability_on_before_...
Donald Sharp [Tue, 31 Jan 2023 13:46:03 +0000 (08:46 -0500)]
Merge pull request #12710 from opensourcerouting/fix/reset_fqdn_capability_on_before_handling_open

bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN

2 years agoMerge pull request #12711 from opensourcerouting/topotest-pid-fix
Donald Sharp [Tue, 31 Jan 2023 13:45:04 +0000 (08:45 -0500)]
Merge pull request #12711 from opensourcerouting/topotest-pid-fix

tests: Topotests fix for deleting wrong pidfile

2 years agozebra: Send nht resolved entry up to concerned protocols in all cases 12708/head
Donald Sharp [Mon, 30 Jan 2023 18:53:44 +0000 (13:53 -0500)]
zebra: Send nht resolved entry up to concerned protocols in all cases

There existed the idea, from Volta, that a nexthop group would not have
the same nexthops installed -vs- what FRR actually sent down.  The
dplane would notify you.

With the addition of 06525c4f99d4dcafdf448565f7e11bd70993697d
the code was put behind a bit of a wall controlled the usage
of it.

The flag ROUTE_ENTRY_USE_FIB_NHG flag was being used
to control which set was being sent up to concerned parties
in nexthop tracking.  Put this flag behind the wall and
do not necessarily set it when we receive a data plane
notification about a route being installed or not.

Fixes: #12706
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agodoc: Define why my pull request was closed 12715/head
Donatas Abraitis [Tue, 31 Jan 2023 11:23:57 +0000 (13:23 +0200)]
doc: Define why my pull request was closed

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agodoc: Add a documentation about commit conventions
Donatas Abraitis [Tue, 31 Jan 2023 10:36:38 +0000 (12:36 +0200)]
doc: Add a documentation about commit conventions

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotools: Add commit linter
Donatas Abraitis [Tue, 31 Jan 2023 09:16:50 +0000 (11:16 +0200)]
tools: Add commit linter

Run under Github Actions, and restrict commit messages, structure, with, etc.

Enforce using only our specified prefixes for commit messages. It reduces the
work release managers do when _crafting_ release notes.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agodoc: Write a short introduction about squashing commits
Donatas Abraitis [Tue, 31 Jan 2023 08:59:01 +0000 (10:59 +0200)]
doc: Write a short introduction about squashing commits

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years ago*: Drop deprecated incorrect JSON fields with wrong naming
Donatas Abraitis [Tue, 31 Jan 2023 08:18:28 +0000 (10:18 +0200)]
*: Drop deprecated incorrect JSON fields with wrong naming

Deprecation cycle already passed.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agoMerge pull request #12709 from donaldsharp/update_withdraw_always_work
Donatas Abraitis [Tue, 31 Jan 2023 06:50:06 +0000 (08:50 +0200)]
Merge pull request #12709 from donaldsharp/update_withdraw_always_work

bgpd: bgp_update and bgp_withdraw never return failures

2 years agotests: Topotests fix for deleting wrong pidfile 12711/head
Martin Winter [Mon, 30 Jan 2023 22:26:48 +0000 (23:26 +0100)]
tests: Topotests fix for deleting wrong pidfile

Fixes killRouterDaemons() function which occasionally deleted the wrong
pidfile.

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
2 years agobgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN 12710/head
Donatas Abraitis [Mon, 30 Jan 2023 21:23:38 +0000 (23:23 +0200)]
bgpd: Vanish FQDN capability hostname/domainname before handling new BGP OPEN

Before this, if the peer disables sending FQDN capability, the old hostname
still (STALE) exists and is misleading in the outputs of `show bgp ...`.

Especially when using with `bgp default show-hostname`, etc.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: Free peer's hostname (aka FQDN capability stuff)
Donatas Abraitis [Mon, 30 Jan 2023 21:22:58 +0000 (23:22 +0200)]
bgpd: Free peer's hostname (aka FQDN capability stuff)

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agotests: Check if we vanish hostname/domainname if disabled from another side
Donatas Abraitis [Mon, 30 Jan 2023 21:22:23 +0000 (23:22 +0200)]
tests: Check if we vanish hostname/domainname if disabled from another side

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agobgpd: bgp_update and bgp_withdraw never return failures 12709/head
Donald Sharp [Mon, 30 Jan 2023 21:02:23 +0000 (16:02 -0500)]
bgpd: bgp_update and bgp_withdraw never return failures

These two functions always return 0.  As such any and all
tests against this make no sense.  Remove the return 0
to a void and follow the chain, logically, to remove all
the dead code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopimd: v6 intentionally turned off route-maps. Turn it on. 12704/head
Donald Sharp [Sun, 29 Jan 2023 03:16:08 +0000 (22:16 -0500)]
pimd: v6 intentionally turned off route-maps.  Turn it on.

Why?

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12700 from taspelund/martian_tip_improvement
Donatas Abraitis [Mon, 30 Jan 2023 08:52:44 +0000 (10:52 +0200)]
Merge pull request #12700 from taspelund/martian_tip_improvement

BGP Martian Tunnel-IP Improvements

2 years agoMerge pull request #12703 from donaldsharp/basic_babel
Donatas Abraitis [Mon, 30 Jan 2023 08:45:49 +0000 (10:45 +0200)]
Merge pull request #12703 from donaldsharp/basic_babel

Basic babel

2 years agotests: Super simple babel test 12703/head
Donald Sharp [Sat, 28 Jan 2023 16:17:08 +0000 (11:17 -0500)]
tests: Super simple babel test

Just get babel started and ensure that the v4 routes
are actually installed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobabeld: During intf startup, ignore address already in use
Donald Sharp [Sat, 28 Jan 2023 14:32:34 +0000 (09:32 -0500)]
babeld: During intf startup, ignore address already in use

When listening on a multicast group.  No need to actually
fail the operation when it's already being used.

Let's not treat the Address already in use error message
as one that is stopping everything from working.  Especially
since multiple interface events cause this to happen.

Without this, if config is read in before full connection
to zebra, babel will never establish neighbors.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobabeld: The function is already a pointer
Donald Sharp [Sat, 28 Jan 2023 14:31:52 +0000 (09:31 -0500)]
babeld: The function is already a pointer

Don't send the address of in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agobgpd: move tunnel-ip comparison into handler 12700/head
Trey Aspelund [Wed, 25 Jan 2023 18:25:20 +0000 (13:25 -0500)]
bgpd: move tunnel-ip comparison into handler

Moves the old/new IP comparison into handle_tunnel_ip_change instead of
expecting the caller to do the check on their own.
Also changes handle_tunnel_ip_change to return void since it only ever
returned 0 in all cases.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2 years agobgpd: only unimport routes if tunnel-ip changes
Trey Aspelund [Wed, 25 Jan 2023 18:07:43 +0000 (13:07 -0500)]
bgpd: only unimport routes if tunnel-ip changes

When processing a new local VNI, we were always walking the global EVPN
table to look for routes that needed to be removed due to a martian
nexthop change (specifically a tunnel-ip change).
Since the martian TIP table is global (all VNIs) + the walk is also in
the global table (all VNIs), we can trust that any new TIP from any VNI
would result in routes getting removed from the global table and
unimported from all live (L2)VNIs.
i.e.
The only time this update is actionable is if we are adding/removing an
IP from the martian TIP table, and we do not need to walk the table for
normal refcount adjustments.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2 years agoMerge pull request #12690 from opensourcerouting/feature/deny_merging_prs_with_freeze...
Donald Sharp [Fri, 27 Jan 2023 12:43:02 +0000 (07:43 -0500)]
Merge pull request #12690 from opensourcerouting/feature/deny_merging_prs_with_freeze_label

github: Prevent merging (fail CI) if 'freeze' label exists for PR

2 years agoMerge pull request #12691 from mjstapp/fix_dplane_prov_lock
Donald Sharp [Fri, 27 Jan 2023 12:35:50 +0000 (07:35 -0500)]
Merge pull request #12691 from mjstapp/fix_dplane_prov_lock

zebra: fix SA warning, don't lock plugin list

2 years agobuild: enable format string warnings 12695/head
David Lamparter [Thu, 26 Jan 2023 13:18:51 +0000 (14:18 +0100)]
build: enable format string warnings

I thought these were included in `-Wall -Wextra`, but apparently not.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobfdd: fix size_t format string
David Lamparter [Fri, 27 Jan 2023 10:14:35 +0000 (11:14 +0100)]
bfdd: fix size_t format string

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: fix silly format string SNAFU
David Lamparter [Thu, 26 Jan 2023 13:55:16 +0000 (14:55 +0100)]
bgpd: fix silly format string SNAFU

Someone thought vty_out accepts a list of strings.  It does not.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agobgpd: fix format string mess in AS-path printing
David Lamparter [Thu, 26 Jan 2023 13:45:11 +0000 (14:45 +0100)]
bgpd: fix format string mess in AS-path printing

This was done *very* weirdly.  Make it slightly less so.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agolib: literal constant format string for termtable
David Lamparter [Thu, 26 Jan 2023 13:23:50 +0000 (14:23 +0100)]
lib: literal constant format string for termtable

While this wasn't a problematic use of a format string, make it a
literal constant so the compiler is happy.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: fix non-const northbound XPath format strings
David Lamparter [Thu, 26 Jan 2023 13:56:04 +0000 (14:56 +0100)]
*: fix non-const northbound XPath format strings

Passing a pre-formatted buffer in these places needs a `"%s"` in front
so it doesn't get formatted twice.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: no-warn pragmas for non-const format strings
David Lamparter [Thu, 26 Jan 2023 13:53:47 +0000 (14:53 +0100)]
*: no-warn pragmas for non-const format strings

We do use non-constant/literal format strings in a few places for more
or less valid reasons;  put `ignored "-Wformat-nonliteral"` around those
so we can have the warning enabled for everywhere else.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years ago*: apply proper format string attributes
David Lamparter [Thu, 26 Jan 2023 13:21:02 +0000 (14:21 +0100)]
*: apply proper format string attributes

So that we get warnings about broken format strings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2 years agoMerge pull request #12696 from donaldsharp/shadowed
Donatas Abraitis [Fri, 27 Jan 2023 09:50:27 +0000 (11:50 +0200)]
Merge pull request #12696 from donaldsharp/shadowed

Shadowed

2 years agolib: Remove global variable exposure `struct host host` 12696/head
Donald Sharp [Thu, 26 Jan 2023 15:53:47 +0000 (10:53 -0500)]
lib: Remove global variable exposure `struct host host`

This was only used in one place and we have accessor functions
now.  So let's use them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agowatchfrr: dmn variable shadows previous declaration
Donald Sharp [Thu, 26 Jan 2023 15:44:52 +0000 (10:44 -0500)]
watchfrr: dmn variable shadows previous declaration

There is no need to declar the same temp variable 2 times.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: i declaration shadows other i declared
Donald Sharp [Thu, 26 Jan 2023 15:41:55 +0000 (10:41 -0500)]
zebra: i declaration shadows other i declared

Clear up some confustion

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agolib: Forward declaration of a struct does not need to have data type
Donald Sharp [Thu, 26 Jan 2023 15:37:39 +0000 (10:37 -0500)]
lib: Forward declaration of a struct does not need to have data type

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoMerge pull request #12694 from donaldsharp/zebra_rib_dead_code
Rafael Zalamena [Thu, 26 Jan 2023 16:30:55 +0000 (13:30 -0300)]
Merge pull request #12694 from donaldsharp/zebra_rib_dead_code

remove dead code

2 years agolib: Remove dead code 12694/head
Donald Sharp [Wed, 25 Jan 2023 20:45:39 +0000 (15:45 -0500)]
lib: Remove dead code

wheel_stop and wheel_start have never been used.  Let's just remove
them.  After close to 7 years, if needed someone else can add back in.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Remove impossible to use function
Donald Sharp [Wed, 25 Jan 2023 20:27:41 +0000 (15:27 -0500)]
zebra: Remove impossible to use function

The rib_update_handle_vrf function is no longer being used.
Cleanup it's usage from zebra.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>