]> git.proxmox.com Git - mirror_frr.git/log
mirror_frr.git
3 years agoMerge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages
David Lamparter [Wed, 29 Sep 2021 12:35:35 +0000 (14:35 +0200)]
Merge pull request #9560 from LabNConsulting/ziemba/frrmod_load-error-messages

frrmod_load(): fix error messages

3 years agoMerge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf
Donald Sharp [Wed, 29 Sep 2021 11:29:39 +0000 (07:29 -0400)]
Merge pull request #9688 from LabNConsulting/working/lb/fix-tt-bgp-vrf

tests:  get bgp_l3vpn_to_bgp_vrf running again, also improve logging (minor)

3 years agoMerge pull request #9422 from pguibert6WIND/update_autort_l3vni
Sri Mohana Singamsetty [Tue, 28 Sep 2021 16:15:34 +0000 (09:15 -0700)]
Merge pull request #9422 from pguibert6WIND/update_autort_l3vni

bgpd: update auto route target for l3vni appropriately

3 years agotests: get bgp_l3vpn_to_bgp_vrf running, also improve logging
Lou Berger [Tue, 28 Sep 2021 15:29:46 +0000 (11:29 -0400)]
tests:  get bgp_l3vpn_to_bgp_vrf running, also improve logging

Signed-off-by: Lou Berger <lberger@labn.net>
3 years agoMerge pull request #9669 from LabNConsulting/chopps/topo-sudo-env
Quentin Young [Tue, 28 Sep 2021 14:53:23 +0000 (10:53 -0400)]
Merge pull request #9669 from LabNConsulting/chopps/topo-sudo-env

3 years agoMerge pull request #9677 from ton31337/fix/zlog_newline_not_needed
Donald Sharp [Tue, 28 Sep 2021 14:44:54 +0000 (10:44 -0400)]
Merge pull request #9677 from ton31337/fix/zlog_newline_not_needed

tools: Add coccinelle script to catch \n or \r at the end of zlog_*

3 years agoMerge pull request #9682 from adrianomarto/mesh-group-fix
Russ White [Tue, 28 Sep 2021 14:21:17 +0000 (10:21 -0400)]
Merge pull request #9682 from adrianomarto/mesh-group-fix

pimd: fixing command "no ip msdp mesh-group member"

3 years agopimd: fixing command "no ip msdp mesh-group member"
Adriano Marto Reis [Tue, 28 Sep 2021 02:38:41 +0000 (12:38 +1000)]
pimd: fixing command "no ip msdp mesh-group member"

Deleting a mesh-group member no longer deletes the mesh-group.

Complete bug description at:
https://github.com/FRRouting/frr/issues/9664

Signed-off-by: Adriano Marto Reis <adrianomarto@gmail.com>
3 years agoMerge pull request #9675 from opensourcerouting/pim-bsm-uaf
Donald Sharp [Mon, 27 Sep 2021 13:45:38 +0000 (09:45 -0400)]
Merge pull request #9675 from opensourcerouting/pim-bsm-uaf

pimd: fix UAF/heap corruption in BSM code

3 years agoMerge pull request #9673 from donaldsharp/bgp_paf
David Lamparter [Mon, 27 Sep 2021 13:37:43 +0000 (15:37 +0200)]
Merge pull request #9673 from donaldsharp/bgp_paf

3 years agotools: Add coccinelle script to catch \n or \r at the end of zlog_*
Donatas Abraitis [Mon, 27 Sep 2021 12:20:51 +0000 (15:20 +0300)]
tools: Add coccinelle script to catch \n or \r at the end of zlog_*

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9672 from donaldsharp/ospf6_newline
David Lamparter [Mon, 27 Sep 2021 08:45:17 +0000 (10:45 +0200)]
Merge pull request #9672 from donaldsharp/ospf6_newline

3 years agopimd: fix UAF/heap corruption in BSM code
David Lamparter [Mon, 27 Sep 2021 08:33:33 +0000 (10:33 +0200)]
pimd: fix UAF/heap corruption in BSM code

This `XFREE()` call is in plainly in the wrong spot.  `rp_all` (the
224.0.0.0/4 entry) isn't supposed to be free'd ever, and the
conditional above makes quite clear that it remains in use.

It may be possible to exploit this as a heap corruption bug, maybe even
as RCE.  I haven't tried; I randomly noticed this while working on the
BSM code.  Luckily this code is only run by the CLI for the clear
command, so the surface is very small.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: Don't lookup paf structure get straight to the point
Donald Sharp [Sun, 26 Sep 2021 23:36:03 +0000 (19:36 -0400)]
bgpd: Don't lookup paf structure get straight to the point

The paf data structure is stored based upon an internal
bgp enum.  The code is looking over all AFI/SAFI's and
doing a paf_af_find which then calls afindex to find
the right paf structure.  Let's just loop over the
peer->peer_af_array[] and cut straight to the chase.
Under some loads the paf_af_find was taking up 6%
of the run time.  This removes it entirely.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Log messages cannot have newlines
Donald Sharp [Sun, 26 Sep 2021 23:16:10 +0000 (19:16 -0400)]
ospf6d: Log messages cannot have newlines

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: add sudo environment setup info for topotests
Christian Hopps [Sat, 25 Sep 2021 18:59:13 +0000 (14:59 -0400)]
doc: add sudo environment setup info for topotests

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agoMerge pull request #9638 from proelbtn/fix-multipath-srv6-sid
Quentin Young [Fri, 24 Sep 2021 18:58:12 +0000 (14:58 -0400)]
Merge pull request #9638 from proelbtn/fix-multipath-srv6-sid

3 years agoMerge pull request #9659 from idryzhov/dev-doc-fix
Quentin Young [Fri, 24 Sep 2021 18:14:44 +0000 (14:14 -0400)]
Merge pull request #9659 from idryzhov/dev-doc-fix

doc: fix code block in grpc docs

3 years agoMerge pull request #9661 from ton31337/fix/bgp_frrtrace_for_lttng
Quentin Young [Fri, 24 Sep 2021 17:53:03 +0000 (13:53 -0400)]
Merge pull request #9661 from ton31337/fix/bgp_frrtrace_for_lttng

3 years agoMerge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate
Russ White [Fri, 24 Sep 2021 17:42:49 +0000 (13:42 -0400)]
Merge pull request #9585 from opensourcerouting/ospf6d-nssa-dflt-originate

ospf6d: add a knob to generate Type-7 default routes

3 years agoMerge pull request #9660 from pguibert6WIND/bgp_error_swap
Donatas Abraitis [Thu, 23 Sep 2021 17:04:24 +0000 (20:04 +0300)]
Merge pull request #9660 from pguibert6WIND/bgp_error_swap

bgpd: swap bgp error value with file descriptor value

3 years agobgpd: Make sure bgp_dest lock/unlock tracepoints works for LTTng as well
Donatas Abraitis [Thu, 23 Sep 2021 13:59:08 +0000 (16:59 +0300)]
bgpd: Make sure bgp_dest lock/unlock tracepoints works for LTTng as well

Tested with both UDST and LTTng, both are OK.

```
[13:57:31.346131253] (+?.?????????) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "10.0.2.0/24", count = 3 }
[13:57:31.346154756] (+0.000023503) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.0.0/24", count = 3 }
[13:57:31.346156699] (+0.000001943) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.10.0/24", count = 2 }
[13:57:31.346157570] (+0.000000871) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.1/32", count = 2 }
[13:57:31.346158521] (+0.000000951) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.2/32", count = 2 }
[13:57:31.356149109] (+0.009990588) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "10.0.2.0/24", count = 3 }
[13:57:31.356155889] (+0.000006780) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.0.0/24", count = 3 }
[13:57:31.356156840] (+0.000000951) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.10.0/24", count = 2 }
[13:57:31.356157751] (+0.000000911) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.1/32", count = 2 }
[13:57:31.356158683] (+0.000000932) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 1 }, { prefix = "192.168.100.2/32", count = 2 }
[13:57:34.508252238] (+3.152093555) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.1/32", count = 2 }
[13:57:34.508289549] (+0.000037311) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.2/32", count = 2 }
[13:57:34.508307544] (+0.000017995) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "172.16.16.3/32", count = 2 }
[13:57:34.508433878] (+0.000126334) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "10.0.2.0/24", count = 2 }
[13:57:34.508435891] (+0.000002013) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "10.0.2.0/24", count = 2 }
[13:57:34.508458182] (+0.000022291) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.0.0/24", count = 2 }
[13:57:34.508458852] (+0.000000670) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.0.0/24", count = 2 }
[13:57:34.508472821] (+0.000013969) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.10.0/24", count = 1 }
[13:57:34.508473482] (+0.000000661) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.10.0/24", count = 1 }
[13:57:34.508487041] (+0.000013559) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.100.1/32", count = 1 }
[13:57:34.508487792] (+0.000000751) home-spine1.donatas.net frr_bgp:bgp_dest_lock: { cpu_id = 2 }, { prefix = "192.168.100.1/32", count = 1 }
```

Converting bgp_dest_lock_node/bgp_dest_unlock_node to non-inlined function
because LTTng can't work properly with inlined and the compiler does not like
it.

Not sure how it would be with the performance, but let's see.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotools: Require a lower LTTng version to compile
Donatas Abraitis [Thu, 23 Sep 2021 13:58:52 +0000 (16:58 +0300)]
tools: Require a lower LTTng version to compile

Debian 9 has 2.9.x, only Ubuntu >= 18 has 2.10.x.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #9084 from louis-oui/fix-ospf6-router-id
Igor Ryzhov [Thu, 23 Sep 2021 16:03:35 +0000 (19:03 +0300)]
Merge pull request #9084 from louis-oui/fix-ospf6-router-id

ospf6d: fix LSAs remain in LSDB with an old router-id value

3 years agobgpd: swap bgp error value with file descriptor value
Philippe Guibert [Thu, 23 Sep 2021 11:57:56 +0000 (13:57 +0200)]
bgpd: swap bgp error value with file descriptor value

the values were swapped by mistake. fix it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agodoc: fix code block in grpc docs
Igor Ryzhov [Thu, 23 Sep 2021 09:08:12 +0000 (12:08 +0300)]
doc: fix code block in grpc docs

The code block after the :: is not displayed correctly without an empty
line in between.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospf6d: reset areas and redistribution at router-id modification
Louis Scalbert [Thu, 10 Jun 2021 09:30:05 +0000 (11:30 +0200)]
ospf6d: reset areas and redistribution at router-id modification

The ospf6 router-id is provided by order of preference by:

 ospf6d itself if the "ospf6 router-id X.X.X.X" command is set.
- zebra. If the "ip router-id X.X.X.X" zebra command is set, the
  configured IP is provided as the ID or alternatively the highest
  loopback IPv4 address or else the highest interface IPv4 address.

The running ospf6 router-id is stored in ospf6->router-id.

ospf6->router-id can change in the following conditions:

- A configuration change provides a new router-id value according to
  the above rules. ospf6->router-id is updated to the new value if
  there is no adjacency in FULL state. Otherwise, the ospf6d process
  must be restarted to take the new router-id into account.
- On startup of both zebra and ospf6d, if ospf6d has not yet received a
  valid router-id, ospf6d->router-id is set to 0 (i.e. 0.0.0.0). Then,
  zebra notifies ospf6d that the router-id is available.

At ospf6->router-id, the current behavior of ospf6d is the following:

- The self generated LSAs that refer to the previous router-id as the
  advertising router are kept.
- Self generated LSAs are created with router-id value.
- LSAs from the redistribution that refer to the previous router-id are
  kept and no new redistribution LSAs are created.

As a consequence, the routers in the ospf6 areas will get incorrect
LSAs and might not be able to install prefixes of those LSAs into their
RIB.

This fix solves this issue by resetting the areas and the redistribution
when ospf6->router-id updated.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agoMerge pull request #9650 from mjstapp/fix_dup_lookup_netlink
Sri Mohana Singamsetty [Wed, 22 Sep 2021 23:18:19 +0000 (16:18 -0700)]
Merge pull request #9650 from mjstapp/fix_dup_lookup_netlink

zebra: stop asking for AF_BRIDGE interface info twice

3 years agoMerge pull request #9653 from pguibert6WIND/carriage_return
Sri Mohana Singamsetty [Wed, 22 Sep 2021 23:17:50 +0000 (16:17 -0700)]
Merge pull request #9653 from pguibert6WIND/carriage_return

bgpd: add carriage return when dumping tags from all evpn rds

3 years agoMerge pull request #9429 from yar-fed/vtysh-err-not-running
Igor Ryzhov [Wed, 22 Sep 2021 19:52:52 +0000 (22:52 +0300)]
Merge pull request #9429 from yar-fed/vtysh-err-not-running

vtysh: Add error code if daemon is not running

3 years agoMerge pull request #9647 from opensourcerouting/ospf-gr-cmd-rename
Donald Sharp [Wed, 22 Sep 2021 18:53:40 +0000 (14:53 -0400)]
Merge pull request #9647 from opensourcerouting/ospf-gr-cmd-rename

ospfd, ospf6d: rename the "graceful-restart helper-only" command

3 years agoMerge pull request #9654 from opensourcerouting/workflow-typesafe-containers
Mark Stapp [Wed, 22 Sep 2021 14:12:09 +0000 (10:12 -0400)]
Merge pull request #9654 from opensourcerouting/workflow-typesafe-containers

doc/workflow: prefer typesafe containers

3 years agoMerge pull request #9635 from donaldsharp/ospf6_unit
David Lamparter [Wed, 22 Sep 2021 12:25:46 +0000 (14:25 +0200)]
Merge pull request #9635 from donaldsharp/ospf6_unit

3 years agoMerge pull request #9646 from LabNConsulting/ziemba/skiplist-level-counters-int
Donald Sharp [Wed, 22 Sep 2021 11:21:14 +0000 (07:21 -0400)]
Merge pull request #9646 from LabNConsulting/ziemba/skiplist-level-counters-int

lib: skiplist: clean up level counter implementation

3 years agoMerge pull request #9651 from proelbtn/refactor-9638
Donald Sharp [Wed, 22 Sep 2021 11:19:31 +0000 (07:19 -0400)]
Merge pull request #9651 from proelbtn/refactor-9638

bgpd: fix mpls nexthop announce in bgp_zebra_announce

3 years agodoc/workflow: prefer typesafe containers
David Lamparter [Wed, 22 Sep 2021 09:59:08 +0000 (11:59 +0200)]
doc/workflow: prefer typesafe containers

The typesafe containers have been around for quite a while now and
haven't gone up in a blaze of flames, so let's add a "strong
recommendation" to use them for new code and refactors.

For the nhrpd custom lists I'm already working to remove them; meanwhile
the old skiplists are primarily used in RFAPI (4 users outside of that),
so those could be next.

What remains are the old `list_*` and `hash_*`, which have >300 and >100
users respectively, making them a much harder problem to tackle.  And
the new hash implementation doesn't have the same level of
debug/introspection yet (it's on my TODO.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: add carriage return when dumping tags from all evpn rds
Philippe Guibert [Wed, 22 Sep 2021 07:59:44 +0000 (09:59 +0200)]
bgpd: add carriage return when dumping tags from all evpn rds

following command: show bgp l2vpn evpn rd all tags
does not append rd contexts one after the other

before:
dut-vm# show bgp l2vpn evpn rd all tags
   Network          Next Hop      In tag/Out tag
Route Distinguisher: 65000:999
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1     Route Distinguisher: 65000:1000
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1
Displayed 2 out of 2 total prefixes

after:
dut-vm# show bgp l2vpn evpn rd all tags
   Network          Next Hop      In tag/Out tag
Route Distinguisher: 65000:999
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1
Route Distinguisher: 65000:1000
*> [5]:[0]:[24]:[10.40.1.0]
                    10.209.36.1

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoMerge pull request #9645 from mjstapp/fix_show_bgp_lu
Donatas Abraitis [Wed, 22 Sep 2021 06:52:09 +0000 (09:52 +0300)]
Merge pull request #9645 from mjstapp/fix_show_bgp_lu

bgpd: make show bgp labeled-unicast work

3 years agobgpd: fix mpls nexthop announce to zebra
Ryoga Saito [Wed, 22 Sep 2021 04:58:59 +0000 (04:58 +0000)]
bgpd: fix mpls nexthop announce to zebra

currently, has_valid_label is only used to check need to print debug,
but if route has normal nexthops and mpls nexthops, label information
will be printed even for normal nexthops.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
3 years agolib: skiplist: clean up level counter implementation
G. Paul Ziemba [Tue, 21 Sep 2021 14:34:20 +0000 (07:34 -0700)]
lib: skiplist: clean up level counter implementation

Signed-off-by: G. Paul Ziemba <paulz@labn.net>
3 years agoMerge pull request #9641 from idryzhov/vtysh-vrf-sort
Donald Sharp [Tue, 21 Sep 2021 20:52:59 +0000 (16:52 -0400)]
Merge pull request #9641 from idryzhov/vtysh-vrf-sort

vtysh: remove sorting of vrf node commands

3 years agoospf6d: implement Type-7 default routes for NSSA areas
Renato Westphal [Mon, 6 Sep 2021 22:52:32 +0000 (19:52 -0300)]
ospf6d: implement Type-7 default routes for NSSA areas

Add the "default-information-originate" option to the "area X nssa"
command. That option allows the origination of Type-7 default routes
on NSSA ABRs and ASBRs.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospf6d: don't generate Type-7 LSA for route created by "default-information-originate"
Renato Westphal [Wed, 8 Sep 2021 16:13:19 +0000 (13:13 -0300)]
ospf6d: don't generate Type-7 LSA for route created by "default-information-originate"

The route created by the "default-information-originate" command
isn't a regular external route. As such, an NSSA ABR shouldn't
originate a corresponding Type-7 LSA for it (there's a separate
configuration knob to generate Type-7 default routes).

While here, fix a small issue in ospf6_asbr_redistribute_add()
where routes created by "default-information-originate" were being
displayed with an incorrect "unknown" type.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospf6d: fix issue when displaying the redistribute command
Renato Westphal [Mon, 6 Sep 2021 22:51:46 +0000 (19:51 -0300)]
ospf6d: fix issue when displaying the redistribute command

When set to its default value, the metric type associated to a
"redistribute" statement shouldn't be displayed as part of the
running configuration.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospf6d: fix metric type of NSSA Type-7 LSAs
Renato Westphal [Mon, 6 Sep 2021 22:50:27 +0000 (19:50 -0300)]
ospf6d: fix metric type of NSSA Type-7 LSAs

Fix wrong comparison since route->path.metric_type is always set
to either 1 or 2. The OSPF6_PATH_TYPE_EXTERNAL2 constant, whose
value is 4, refers to a route type so its usage was incorrect here.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: rename the "graceful-restart helper-only" command
Renato Westphal [Tue, 21 Sep 2021 14:33:55 +0000 (11:33 -0300)]
ospfd: rename the "graceful-restart helper-only" command

Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Start a deprecation cycle of one year before removing the original
command

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agozebra: stop asking for AF_BRIDGE interface info twice
Mark Stapp [Tue, 21 Sep 2021 20:33:28 +0000 (16:33 -0400)]
zebra: stop asking for AF_BRIDGE interface info twice

There were two identical blocks of code run at init time that
requested info about AF_BRIDGE - don't see any reason to do that
twice, so remove one block.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
3 years agobgpd: fix annouce for multipath SRv6 SID routes
Ryoga Saito [Sun, 19 Sep 2021 15:51:29 +0000 (15:51 +0000)]
bgpd: fix annouce for multipath SRv6 SID routes

In current implementation, only last path in mpinfo is treated as seg6
nexthop, but all paths should be treated as seg6 nexthop.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
3 years agoospf6d: factorize router-id update
Louis Scalbert [Wed, 30 Jun 2021 13:18:50 +0000 (15:18 +0200)]
ospf6d: factorize router-id update

ospf6_router_id_update function is used by ospf6_router_id_update_zebra
to update the running the ospf6 router-id.

This patches makes the functions to (un)configure ospf6 router-id use
the same function as ospf6_router_id_update_zebra.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agoospf6d: don't update router-id if at least one adjacency is Full
Louis Scalbert [Fri, 4 Jun 2021 12:22:06 +0000 (14:22 +0200)]
ospf6d: don't update router-id if at least one adjacency is Full

When a router-id change is notified by zebra to ospf6d, we only take
into account the change if no adjacencies are in Full state.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
3 years agoMerge pull request #9416 from pguibert6WIND/vxlan_evpn_updates
Sri Mohana Singamsetty [Tue, 21 Sep 2021 16:26:34 +0000 (09:26 -0700)]
Merge pull request #9416 from pguibert6WIND/vxlan_evpn_updates

Vxlan evpn updates

3 years agoMerge pull request #9546 from proelbtn/add-support-for-perfix-sid-type-5
Russ White [Tue, 21 Sep 2021 15:36:53 +0000 (11:36 -0400)]
Merge pull request #9546 from proelbtn/add-support-for-perfix-sid-type-5

Add support for Prefix-SID (Type 5)

3 years agoMerge pull request #9640 from opensourcerouting/ospf6d-filters
Russ White [Tue, 21 Sep 2021 15:28:58 +0000 (11:28 -0400)]
Merge pull request #9640 from opensourcerouting/ospf6d-filters

ospf6d: rework filtering commands to be in line with ospfd

3 years agoMerge pull request #9637 from donaldsharp/intra_brouter_calc
Russ White [Tue, 21 Sep 2021 15:25:14 +0000 (11:25 -0400)]
Merge pull request #9637 from donaldsharp/intra_brouter_calc

ospf6d: Use bool instead of an int

3 years agobgpd: make show bgp labeled-unicast work
Mark Stapp [Tue, 21 Sep 2021 14:37:39 +0000 (10:37 -0400)]
bgpd: make show bgp labeled-unicast work

Yet-another path where the safi needs to be changed to locate
the unicast table where LU routes live.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
3 years agoMerge pull request #9052 from mjstapp/dplane_incoming_dev
Donald Sharp [Tue, 21 Sep 2021 14:51:37 +0000 (10:51 -0400)]
Merge pull request #9052 from mjstapp/dplane_incoming_dev

zebra: Move incoming netlink interface address change events to the dplane pthread

3 years agoospf6d: rename the "graceful-restart helper-only" command
Renato Westphal [Tue, 21 Sep 2021 13:40:10 +0000 (10:40 -0300)]
ospf6d: rename the "graceful-restart helper-only" command

Considering that both the GR helper mode and restarting mode can be
enabled at the same time, the "graceful-restart helper-only" command
can be a bit misleading since it implies that only the helper mode
is enabled. Rename the command to "graceful-restart helper enable"
to clarify what the command does.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agovtysh: Add error code if daemon is not running
Yaroslav Fedoriachenko [Tue, 17 Aug 2021 15:30:03 +0000 (18:30 +0300)]
vtysh: Add error code if daemon is not running

After `<daemon_name> is not running` message vtysh does not return
error. For example if you disable ospf in `/etc/frr/daemons` and run
`vtysh -c configure -c "router ospf"` it prints the message to stderr,
but returns 0.

This commit will make vtysh return error when not in interractive mode.

But if you run commands from vtysh, you will still be able to enter
views and exit them if daemon is not running.

Signed-off-by: Yaroslav Fedoriachenko <yar.fed99@gmail.com>
3 years agotools: Add some new suppressions
Donald Sharp [Fri, 17 Sep 2021 15:45:35 +0000 (11:45 -0400)]
tools: Add some new suppressions

Bunch of new stuff came in w/ the libyang2 upgrade that needs
to be suppressed.  Make it so.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Fix debug string in rare case
Donald Sharp [Fri, 17 Sep 2021 13:25:54 +0000 (09:25 -0400)]
ospf6d: Fix debug string in rare case

When looking up the o_path->ls_prefix if it is not found
the debug statement was using a buf that was never initialized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Always pre-init all header values to 0
Donald Sharp [Fri, 17 Sep 2021 09:47:16 +0000 (05:47 -0400)]
ospf6d: Always pre-init all header values to 0

When making the ospf6 header, let's actually fill
in all the header values

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopimd: Prevent uninited usage of nexthop
Donald Sharp [Fri, 17 Sep 2021 09:41:37 +0000 (05:41 -0400)]
pimd: Prevent uninited usage of nexthop

pim_msdp_peer_rpf_check creates an nexthop to do
a rpf search against and doesn't initialize it
sucht that the pim_nexthop_lookup function is
making decisions against the nexthop just
created that was uninitialized.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Use appropriate integer size and more context for reason strings
Donald Sharp [Tue, 21 Sep 2021 11:52:54 +0000 (07:52 -0400)]
ospf6d: Use appropriate integer size and more context for reason strings

The ospfv3 spf reason strings are just presented internally in the code
without any real context.  Give a tiny bit more useful information for
the developer and convert the integer to a uint32_t

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9642 from slrz/doc-user-routemap-mention-as-path-exclude
Donald Sharp [Tue, 21 Sep 2021 11:49:31 +0000 (07:49 -0400)]
Merge pull request #9642 from slrz/doc-user-routemap-mention-as-path-exclude

doc: mention set as-path exclude in routemap.rst

3 years agodoc: mention set as-path exclude in routemap.rst
Lars Seipel [Mon, 20 Sep 2021 18:43:58 +0000 (20:43 +0200)]
doc: mention set as-path exclude in routemap.rst

Signed-off-by: Lars Seipel <ls@slrz.net>
3 years agovtysh: remove sorting of vrf node commands
Igor Ryzhov [Wed, 15 Sep 2021 15:22:47 +0000 (18:22 +0300)]
vtysh: remove sorting of vrf node commands

A simple strcmp-based sorting done by `config_add_line_uniq` breaks the
correct advanced sorting of static routes done by staticd. We don't
actually need to check vrf node commands for uniqueness as all commands
are daemon specific, so let's use simple `config_add_line` that doesn't
sort commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #9636 from donaldsharp/unchecked_return
Igor Ryzhov [Mon, 20 Sep 2021 17:12:54 +0000 (20:12 +0300)]
Merge pull request #9636 from donaldsharp/unchecked_return

zebra: Fix ignored return value from inet_pton

3 years agoospf6d: rework filtering commands to be in line with ospfd
Renato Westphal [Sat, 18 Sep 2021 00:45:02 +0000 (21:45 -0300)]
ospf6d: rework filtering commands to be in line with ospfd

Issue #9535 describes how the export-list/import-list commands work
differently on ospfd and ospf6d.

In short:
* On ospfd, "area A.B.C.D export-list" filters which internal
  routes an ABR exports to other areas. On ospf6d, instead, that
  command filters which inter-area routes an ABR exports to the
  configured area (which is quite counter-intuitive). In other words,
  both commands do the same but in opposite directions.
* On ospfd, "area A.B.C.D import-list" filters which inter-area
  routes an ABR imports into the configured area. On ospf6d, that
  command filters which inter-area routes an interior router accepts.
* On both daemons, "area A.B.C.D filter-list prefix NAME <in|out>"
  works exactly the same as import/export lists, but using prefix-lists
  instead of ACLs.

The inconsistency on how those commands work is undesirable. This
PR proposes to adapt the ospf6d commands to behave like they do
in ospfd.

These changes are obviously backward incompatible and this PR doesn't
propose any mitigation strategy other than warning users about the
changes in the next release notes. Since these ospf6d commands are
undocumented and work in such a peculiar way, it's unlikely many
users will be affected (if any at all).

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agozebra: Fix ignored return value from inet_pton
Donald Sharp [Fri, 17 Sep 2021 16:23:37 +0000 (12:23 -0400)]
zebra: Fix ignored return value from inet_pton

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospf6d: Use bool instead of an int
Donald Sharp [Sun, 19 Sep 2021 11:53:38 +0000 (07:53 -0400)]
ospf6d: Use bool instead of an int

intra_brouter_calc is a int that is being used a bool,
convert to a bool.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9632 from donaldsharp/no_forced_wait
Russ White [Fri, 17 Sep 2021 16:22:36 +0000 (12:22 -0400)]
Merge pull request #9632 from donaldsharp/no_forced_wait

tests: Do not do a initial_timeout of 2 seconds for verify_bgp_rib

3 years agoMerge pull request #8985 from opensourcerouting/ospf6d-gr
Russ White [Fri, 17 Sep 2021 16:22:07 +0000 (12:22 -0400)]
Merge pull request #8985 from opensourcerouting/ospf6d-gr

ospf6d: introduce support for Graceful Restart (restarting mode)

3 years agoMerge pull request #9620 from idryzhov/bgp-rmap-memleaks
Donatas Abraitis [Fri, 17 Sep 2021 12:48:25 +0000 (15:48 +0300)]
Merge pull request #9620 from idryzhov/bgp-rmap-memleaks

bgpd: fix memory leaks when using route-maps

3 years agoMerge pull request #9628 from donaldsharp/git_ignore_pcep
Donatas Abraitis [Fri, 17 Sep 2021 12:47:00 +0000 (15:47 +0300)]
Merge pull request #9628 from donaldsharp/git_ignore_pcep

*: Add some missed make check generated files in .gitignore

3 years agoMerge pull request #9629 from idryzhov/nb-cli-sort
Mark Stapp [Fri, 17 Sep 2021 12:29:00 +0000 (08:29 -0400)]
Merge pull request #9629 from idryzhov/nb-cli-sort

lib: significantly improve nb cli command sorting

3 years agolib: significantly improve nb cli command sorting
Igor Ryzhov [Thu, 16 Sep 2021 15:37:12 +0000 (18:37 +0300)]
lib: significantly improve nb cli command sorting

Instead of sorting each command one-by-one using listnode_add_sort, add
them to the list without sorting and then sort the list only once.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agozebra: refresh vxlan evpn contexts, when bridge interface goes up
Philippe Guibert [Tue, 17 Aug 2021 08:56:32 +0000 (10:56 +0200)]
zebra: refresh vxlan evpn contexts, when bridge interface goes up

When using bgp evpn rt5 setup, after BGP configuration has been
loaded, if the user attempts to detach and reattach the bridged
vxlan interface from the bridge, then BGP loses its BGP EVPN
contexts, and a refresh of BGP configuration is necessary to
maintain consistency between linux configuration and BGP EVPN
contexts (RIB). The following command can lead to inconsistency:

ip netns exec cust1 ip link set dev vxlan1000 nomaster
ip netns exec cust1 ip link set dev vxlan1000 master br1000

consecutive to the, BGP l2vpn evpn RIB is empty, and the way to
solve this until now is to reconfigure EVPN like this:

vrf cust1
 no vni 1000
 vni 1000
exit-vrf

Actually, the link information is correctly handled. In fact,
at the time of link event, the lower link status of the bridge
interface was not yet up, thus preventing from establishing
BGP EVPN contexts. In fact, when a bridge interface does not
have any slave interface, the link status of the bridge interface
is down. That change of status comes a bit after, and is not
detected by slave interfaces, as this event is not intercepted.

This commit intercepts the bridge link up event, and triggers
a check on slaved vxlan interfaces.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agozebra: handle bridge mac address update in evpn contexts
Philippe Guibert [Tue, 17 Aug 2021 08:42:51 +0000 (10:42 +0200)]
zebra: handle bridge mac address update in evpn contexts

when running bgp evpn rt5 setup, the Rmac sent in BGP updates
stands for the MAC address of the bridge interface. After
having loaded frr configuration, the Rmac address is not refreshed.
This issue can be easily reproduced by executing some commands:

ip netns exec cust1 ip link set dev br1000 address  2e:ab:45:aa:bb:cc

Actually, the BGP EVPN contexts are kept unchanged.
That commit proposes to fix this by intercepting the mac address
change, and refreshing the vxlan interfaces attached to te bridge
interface that changed its MAC address.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoMerge pull request #9235 from AnuradhaKaruppiah/nht_mh
Sri Mohana Singamsetty [Thu, 16 Sep 2021 21:52:45 +0000 (14:52 -0700)]
Merge pull request #9235 from AnuradhaKaruppiah/nht_mh

bgpd: Extend EVPN next hop tracking to type-1 and type-4 routes

3 years agoMerge pull request #9619 from AnuradhaKaruppiah/lttng-updates
Jafar Al-Gharaibeh [Thu, 16 Sep 2021 19:55:43 +0000 (14:55 -0500)]
Merge pull request #9619 from AnuradhaKaruppiah/lttng-updates

lttng build updates

3 years agotests: Do not do a initial_timeout of 2 seconds for verify_bgp_rib
Donald Sharp [Thu, 16 Sep 2021 19:12:13 +0000 (15:12 -0400)]
tests: Do not do a initial_timeout of 2 seconds for verify_bgp_rib

A bunch of tests have this pattern:

a) Install a new prefix into bgp
b) Run this loop:
foreach (router in topology) {
verify_bgp_rib(router)
}

This is to ensure that the prefix is actually disseminated.
The problem with this, of course, is that a wait of 2 seconds
for every item in that loop makes no sense.  As that the initial
router verification of it's bgp rib will wait 2 seconds and
all the remaining bgp routers in the topology will have gotten
the data.  So we end up waiting a bunch of extra time.

Remove the initial_wait time for verify_bgp_rib.  Also
increase the failure wait time to 30 seconds.  This is
to give a bigger window for bgp to send it's data for
our test systems that could be under heavy load.  In the
normal case tests will never hit this.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9627 from donaldsharp/connect_interface_based_issue
Donatas Abraitis [Thu, 16 Sep 2021 18:14:43 +0000 (21:14 +0300)]
Merge pull request #9627 from donaldsharp/connect_interface_based_issue

bgpd: Allow v6 LL peers to work when connected to as well

3 years agoMerge pull request #9489 from opensourcerouting/pim-restruct-20210825
Donald Sharp [Thu, 16 Sep 2021 16:32:45 +0000 (12:32 -0400)]
Merge pull request #9489 from opensourcerouting/pim-restruct-20210825

pimd: move IGMP memberships from socket to iface, + some cleanups

3 years agoospf6d: fix build problem with ancient json-c versions
Renato Westphal [Mon, 12 Jul 2021 12:29:06 +0000 (09:29 -0300)]
ospf6d: fix build problem with ancient json-c versions

Some CI VMs are using really old versions of json-c (pre 2013 [1])
that expect filenames to be passed as "char *" instead of "const char *".

Add some explicit casts to fix the resulting compiler errors on those
VMs (passing "char *" when the API expects "const char *" is fine).
Hopefully this commit should be reverted once the CI is updated to use
newer versions of json-c.

[1] https://github.com/json-c/json-c/commit/20e4708c

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agotests: add OSPFv3 graceful restart topotest
Renato Westphal [Wed, 30 Jun 2021 18:12:30 +0000 (15:12 -0300)]
tests: add OSPFv3 graceful restart topotest

Add a new topotest that features a topology with seven routers spread
across four OSPF areas:
* 1 backbone area;
* 1 regular non-backbone area (0.0.0.1);
* 1 stub area (0.0.0.2);
* 1 NSSA area (0.0.0.3).

All routers have both GR and GR helper functionality enabled in
the configuration. The test consists of restarting each router,
one at time, and checking that all forwarding planes (and LSDBs)
are kept intact during those restarts.

A successful run takes about three minutes to finish.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospf6d: introduce support for Graceful Restart (restarting mode)
Renato Westphal [Fri, 2 Jul 2021 16:01:32 +0000 (13:01 -0300)]
ospf6d: introduce support for Graceful Restart (restarting mode)

RFC 5187 specifies the Graceful Restart enhancement to the OSPFv3
routing protocol. This commit implements support for the GR
restarting mode.

Here's a quick summary of how the GR restarting mode works:
* GR can be enabled on a per-instance basis using the `graceful-restart
  [grace-period (1-1800)]` command;
* To perform a graceful shutdown, the `graceful-restart prepare ipv6
  ospf` EXEC-level command needs to be issued before restarting the
  ospf6d daemon (there's no specific requirement on how the daemon
  should be restarted);
* `graceful-restart prepare ospf` will initiate the graceful restart
  for all GR-enabled instances by taking the following actions:
  o Flooding Grace-LSAs over all interfaces
  o Freezing the OSPF routes in the RIB
  o Saving the end of the grace period in non-volatile memory (a JSON
    file stored in `$frr_statedir`)
* Once ospf6d is started again, it will follow the procedures
  described in RFC 3623 until it detects it's time to exit the graceful
  restart (either successfully or unsuccessfully).

Testing done:
* New topotest featuring a multi-area OSPF topology (including stub
  and NSSA areas);
* Successful interop tests against IOS-XR routers acting as helpers.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospf6d: add missing entry to array of strings
Renato Westphal [Sat, 10 Jul 2021 15:20:25 +0000 (12:20 -0300)]
ospf6d: add missing entry to array of strings

Commit b8212e0310 introduced OSPF6_SPF_FLAGS_ASBR_STATUS_CHANGE but
didn't update the 'ospf6_spf_reason_str' array accordingly. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years ago*: Add some missed make check generated files in .gitignore
Donald Sharp [Thu, 16 Sep 2021 12:05:25 +0000 (08:05 -0400)]
*: Add some missed make check generated files in .gitignore

Some pcep log output from `make check` is showing up in
git status.  Make git know it's ok to ignore this stuff.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agobgpd: Allow v6 LL peers to work when connected to as well
Donald Sharp [Thu, 16 Sep 2021 12:00:44 +0000 (08:00 -0400)]
bgpd: Allow v6 LL peers to work when connected to as well

Initial commit: 8761cd6ddb5437767625f58c8e9cc3ccda7887ab

introduced the idea of v6 LL using interface up/down events
instead of nexthop resolution to know when a peering should
happen or not.  This above commit left a hole where if the remote
peer connected to this bgp, the bgp code would still believe
the peering is down.   Modify the code to double check and
ensure that we have proper v6 LL resolution flags set.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #9614 from idryzhov/bgp-aspath-coverity
Donatas Abraitis [Thu, 16 Sep 2021 12:03:25 +0000 (15:03 +0300)]
Merge pull request #9614 from idryzhov/bgp-aspath-coverity

bgpd: fix coverity warning

3 years agoMerge pull request #9623 from donaldsharp/test_bgp_table
Donatas Abraitis [Thu, 16 Sep 2021 06:03:12 +0000 (09:03 +0300)]
Merge pull request #9623 from donaldsharp/test_bgp_table

tests: Fix make check builds on some bsd variants

3 years agoMerge pull request #9622 from taspelund/arp_sysctl_formatting
Donatas Abraitis [Thu, 16 Sep 2021 05:56:13 +0000 (08:56 +0300)]
Merge pull request #9622 from taspelund/arp_sysctl_formatting

doc: fixup formatting in zebra.rst

3 years agotests: Fix make check builds on some bsd variants
Donald Sharp [Thu, 16 Sep 2021 01:10:24 +0000 (21:10 -0400)]
tests: Fix make check builds on some bsd variants

Compilation is warning that a memcpy is only copying
the first (sizeof pointer) into memory.  This is not
what we really want.  Although it does beg the question about
why this memcpy is needed( or what it is doing ).  I'm going
to just fix the memcpy and call it a day.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: fixup formatting in zebra.rst
Trey Aspelund [Thu, 16 Sep 2021 00:50:55 +0000 (20:50 -0400)]
doc: fixup formatting in zebra.rst

Swap out incorrect usage of '^' with proper usage of '-'.

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agoMerge pull request #9596 from LabNConsulting/ziemba/printfrr-nexthop
Donald Sharp [Thu, 16 Sep 2021 00:23:30 +0000 (20:23 -0400)]
Merge pull request #9596 from LabNConsulting/ziemba/printfrr-nexthop

printfrr %pNHcg, %pNHci

3 years agoMerge pull request #9613 from aaronpereira88/evpn-rt1-legend
Donald Sharp [Thu, 16 Sep 2021 00:22:46 +0000 (20:22 -0400)]
Merge pull request #9613 from aaronpereira88/evpn-rt1-legend

bgpd: Update route-type-1 legend to match output

3 years agoMerge pull request #9617 from idryzhov/ospf6-cleanup-om6
Donald Sharp [Thu, 16 Sep 2021 00:19:12 +0000 (20:19 -0400)]
Merge pull request #9617 from idryzhov/ospf6-cleanup-om6

ospf6d: cleanup useless checks

3 years agobgpd: fix memory leaks when using route-maps
Igor Ryzhov [Wed, 15 Sep 2021 19:45:23 +0000 (22:45 +0300)]
bgpd: fix memory leaks when using route-maps

There are places where we use route-maps using duplicated attributes and
neither intern nor flush them after the usage. If a route-map has set
rules for aspath/communities, they will be allocated and never freed.
We should always flush unneeded duplicated attributes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agotests: include lttng libs in the bgp tests build
Anuradha Karuppiah [Wed, 15 Sep 2021 18:17:03 +0000 (11:17 -0700)]
tests: include lttng libs in the bgp tests build

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>
3 years agobuild: change the lttng version requirements in frr
Anuradha Karuppiah [Tue, 14 Sep 2021 16:47:51 +0000 (09:47 -0700)]
build: change the lttng version requirements in frr

Lower the version requirements from 2.12 to 2.10

Signed-off-by: Anuradha Karuppiah <anuradhak@nvidia.com>