]> git.puffer.fish Git - matthieu/frr.git/log
matthieu/frr.git
3 years agodoc: add a note of hostname/domainname for vtysh
anlancs [Thu, 10 Jun 2021 01:36:19 +0000 (09:36 +0800)]
doc: add a note of hostname/domainname for vtysh

These names are saved in current vtysh's memory, can't and needn't be saved into
configure file by watchfrr's 'vtysh -w`.

Signed-off-by: anlancs <anlan_cs@tom.com>
3 years agoMerge pull request #8798 from opensourcerouting/ospfd-fixes
Olivier Dugeon [Wed, 9 Jun 2021 07:06:42 +0000 (09:06 +0200)]
Merge pull request #8798 from opensourcerouting/ospfd-fixes

ospfd: assorted fixes

3 years agoMerge pull request #8593 from idryzhov/cmd-ambiguous
Quentin Young [Tue, 8 Jun 2021 15:41:45 +0000 (15:41 +0000)]
Merge pull request #8593 from idryzhov/cmd-ambiguous

vtysh: fix searching commands in parent nodes

3 years agoMerge pull request #8796 from idryzhov/ospf-passive
Russ White [Tue, 8 Jun 2021 15:24:30 +0000 (11:24 -0400)]
Merge pull request #8796 from idryzhov/ospf-passive

ospfd: fix passive interface configuration

3 years agoMerge pull request #7096 from gpnaveen/ospf_asbr_summarisation
Olivier Dugeon [Tue, 8 Jun 2021 15:20:33 +0000 (17:20 +0200)]
Merge pull request #7096 from gpnaveen/ospf_asbr_summarisation

tests : Adding 2 ospf asbr summary testcases.

3 years agoospfd: fix crash when displaying neighbor data in JSON
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when displaying neighbor data in JSON

Add a null check to protect against the case where the neighbor
inactive timer is disabled. That can happen when the router is
acting as a helper for another router that is attempting to restart
gracefully.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agolib, ospfd, ospf6d: fix logging of pointer addresses
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
lib, ospfd, ospf6d: fix logging of pointer addresses

The %p printf format specifier does already print the pointer address
with a leading "0x" prefix (indicating a hexadecimal number). There's
no need to add that prefix manually.

While here, replace explicit function names in log messages by
__func__.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix wrong NSSA debug guards
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix wrong NSSA debug guards

Fix usage of NSSA debug guards in code paths that have nothing to
do with NSSA areas.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agozebra, ospfd: fix typos in the graceful restart code
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
zebra, ospfd: fix typos in the graceful restart code

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix logging of what triggered the SPF run
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix logging of what triggered the SPF run

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix cleanup of MaxAge LSAs on exit
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix cleanup of MaxAge LSAs on exit

During shutdown, the ospf->maxage_lsa table is iterated over to
clean up all existing entries. While doing that, route_unlock_node()
should be called only for the nodes that have an associated entry,
otherwise the table will get corrupted and ospfd will crash.

As a side note, using a routing table to store MaxAge LSAs was a
very poor choice of a data structure, considering that a simple
rb-tree or hash table would get the job done with a much simpler
(and less error-prone) API. Something to cleanup in the future...

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix null pointer dereference when flushing an opaque LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix null pointer dereference when flushing an opaque LSA

Call ospf_lsa_flush() before free_opaque_info_per_id() since the
latter can deallocate the LSA that is going to be flushed.

Also, there's no need to set the LSA MaxAge to OSPF_LSA_MAXAGE
manually as the ospf_lsa_flush() function already takes care of that.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix dangling pointer when exiting from the helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix dangling pointer when exiting from the helper mode

When exiting from the helper mode for a given router after an
unsuccessful graceful restart, removing the neighborship to that
router straight away leads to a dangling pointer in the associated
interface, which inevitably leads to a crash. To solve this
problem, schedule the removal of the neighbor instead of removing
it immediately.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix crash when logging a Grace-LSA
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix crash when logging a Grace-LSA

Change the "show_ospf_grace_lsa_info" callback to account for the
fact that the "vty" parameter can be null.

This fixes a crash that happens when "debug ospf packet ls-update
detail" is configured and a Grace-LSA is sent or received.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix small issue when exiting from the GR helper mode
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix small issue when exiting from the GR helper mode

When exiting from the GR helper mode, recalculate the DR only for
interfaces of the appropriate types (broadcast and NMBA).

This fixes a problem where the state of a neighbor reachable over a
p2p interface was changing from Full/DROther to Full/Backup across
a graceful restart.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoospfd: fix GR helper initialization and termination
Renato Westphal [Mon, 31 May 2021 13:27:51 +0000 (10:27 -0300)]
ospfd: fix GR helper initialization and termination

Since a single ospfd process can have multiple OSPF interfaces
configured, we need to separate the global GR initialization and
termination from per-instance initialization and termination.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #8727 from opensourcerouting/ospfv3-nssa
Russ White [Tue, 8 Jun 2021 14:24:29 +0000 (10:24 -0400)]
Merge pull request #8727 from opensourcerouting/ospfv3-nssa

ospf6d: implement NSSA area support

3 years agoMerge pull request #8713 from LabNConsulting/chopps/grpc-unit-test
Quentin Young [Tue, 8 Jun 2021 14:00:10 +0000 (14:00 +0000)]
Merge pull request #8713 from LabNConsulting/chopps/grpc-unit-test

3 years agoMerge pull request #8782 from LabNConsulting/chopps/timing-test
Rafael Zalamena [Tue, 8 Jun 2021 13:46:04 +0000 (10:46 -0300)]
Merge pull request #8782 from LabNConsulting/chopps/timing-test

tests: timing large config operations

3 years agoMerge pull request #8806 from donaldsharp/established
Sri Mohana Singamsetty [Mon, 7 Jun 2021 22:20:40 +0000 (15:20 -0700)]
Merge pull request #8806 from donaldsharp/established

bgpd: Convert to using peer_established(peer) function

3 years agotests: timing large config operations
Christian Hopps [Wed, 2 Jun 2021 22:32:37 +0000 (22:32 +0000)]
tests: timing large config operations

To start we use 10k static route config. This test goes along with
recent batching changes it will fail w/o them (b/c some operations w/o
batching take 100 times as long).

This test should be added to over time for other large config
items (e.g., acl, policy, etc)

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agoMerge pull request #8805 from opensourcerouting/find-asan-crash
Igor Ryzhov [Mon, 7 Jun 2021 20:19:55 +0000 (23:19 +0300)]
Merge pull request #8805 from opensourcerouting/find-asan-crash

lib: fix address sanitizer crash on `find`

3 years agobgpd: Convert to using peer_established(peer) function
Donald Sharp [Mon, 7 Jun 2021 13:39:10 +0000 (09:39 -0400)]
bgpd: Convert to using peer_established(peer) function

We are inconsistently using peer_establiahed(peer) with
sometimes using `peer->status == Established`.  Just Convert
over to using the function for consistency.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #8789 from FRRouting/doctest
Donatas Abraitis [Mon, 7 Jun 2021 14:19:07 +0000 (17:19 +0300)]
Merge pull request #8789 from FRRouting/doctest

doc: bump sphinx version to 4.0.2, remove deprecated API

3 years agolib: fix address sanitizer crash on `find`
Rafael Zalamena [Mon, 7 Jun 2021 14:02:16 +0000 (11:02 -0300)]
lib: fix address sanitizer crash on `find`

Fix the following address sanitizer crash when running the command `find`:

  ERROR: AddressSanitizer: dynamic-stack-buffer-overflow
  WRITE of size 1 at 0x7fff4840fc1d thread T0
      0  in print_cmd ../lib/command.c:1541
      1  in cmd_find_cmds ../lib/command.c:2364
      2  in find ../vtysh/vtysh.c:3732
      3  in cmd_execute_command_real ../lib/command.c:995
      4  in cmd_execute_command ../lib/command.c:1055
      5  in cmd_execute ../lib/command.c:1219
      6  in vtysh_execute_func ../vtysh/vtysh.c:486
      7  in vtysh_execute ../vtysh/vtysh.c:671
      8  in main ../vtysh/vtysh_main.c:721
      9  in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
      10 in _start (/usr/bin/vtysh+0x21f64d)

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoMerge pull request #8778 from idryzhov/fix-zebra-vrf
Rafael Zalamena [Mon, 7 Jun 2021 11:59:10 +0000 (08:59 -0300)]
Merge pull request #8778 from idryzhov/fix-zebra-vrf

zebra: fix config after exit from vrf

3 years agoMerge pull request #8758 from idryzhov/bfd-fixes
Rafael Zalamena [Mon, 7 Jun 2021 11:34:06 +0000 (08:34 -0300)]
Merge pull request #8758 from idryzhov/bfd-fixes

BFD fixes

3 years agoMerge pull request #8781 from idryzhov/fix-list-find
Rafael Zalamena [Mon, 7 Jun 2021 11:32:31 +0000 (08:32 -0300)]
Merge pull request #8781 from idryzhov/fix-list-find

lib: fix output of "list" and "find" commands

3 years agoMerge pull request #8756 from volta-networks/ospfd_sr_blocks
Olivier Dugeon [Mon, 7 Jun 2021 09:15:03 +0000 (11:15 +0200)]
Merge pull request #8756 from volta-networks/ospfd_sr_blocks

ospfd, doc: combined SRGB/SRLB command

3 years agoMerge pull request #8801 from donaldsharp/SR_coverity
Donatas Abraitis [Mon, 7 Jun 2021 06:52:08 +0000 (09:52 +0300)]
Merge pull request #8801 from donaldsharp/SR_coverity

Sr coverity

3 years agotests: add grpc unit test
Christian Hopps [Thu, 20 May 2021 23:22:14 +0000 (19:22 -0400)]
tests: add grpc unit test

Test uses staticd which required some C++ header protections.
Additionally, the test also runs in the ubuntu20 docker container as
grpc is supported there by the packaging system.

Signed-off-by: Christian Hopps <chopps@labn.net>
3 years agobgpd: bgp_vrf has already been derefed in all paths
Donald Sharp [Sat, 5 Jun 2021 16:57:55 +0000 (12:57 -0400)]
bgpd: bgp_vrf has already been derefed in all paths

Coverity scan found this issue.  The bgp_vrf variable in
ensure_vrf_tovpn_sid() has already been derefed in all paths
at this point in time.  No need to check for it existing
at this point.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopathd: Remove unused function
Donald Sharp [Sat, 5 Jun 2021 16:55:48 +0000 (12:55 -0400)]
pathd: Remove unused function

format_yang_dnode is never used and it has coverity issues, removing

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agodoc: replace "passive-interface IFNAME" with "ip ospf passive"
Igor Ryzhov [Sat, 5 Jun 2021 14:53:23 +0000 (17:53 +0300)]
doc: replace "passive-interface IFNAME" with "ip ospf passive"

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd: fix passive interface configuration
Igor Ryzhov [Fri, 4 Jun 2021 14:47:32 +0000 (17:47 +0300)]
ospfd: fix passive interface configuration

Currently, passive interface flag is configured from the router node
using "passive-interface IFNAME". There are multiple problems with this
command:
- it is not in line with all other interface-related commands - other
  parameters are configured from the interface node using "ip ospf"
  prefix
- it is not in line with OSPFv3 - passive flag is configured from the
  interface node using "ipv6 ospf6 passive" command
- most importantly, it doesn't work correctly when the interface is in
  a different VRF - when using VRF-lite, it incorrectly changes the
  vrf_id of the interface and it becomes desynced with the actual state;
  when using netns, it creates a new fake interface and configures it
  instead of configuring the necessary interface

To fix all the problems, this commit adds a new command to the interface
configuration node - "ip ospf passive". The purpose of the command is
completely the same, but it works correctly in a multi-VRF environment.

The old command is preserved for the backward compatibility, but the
warning is added that it is deprecated because it doesn't work correctly
with VRFs.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8706 from LabNConsulting/chopps/fix-grpc-threading
Quentin Young [Fri, 4 Jun 2021 20:31:34 +0000 (20:31 +0000)]
Merge pull request #8706 from LabNConsulting/chopps/fix-grpc-threading

3 years agoMerge pull request #5865 from slankdev/slankdev-zebra-srv6-manager
Mark Stapp [Fri, 4 Jun 2021 17:41:55 +0000 (13:41 -0400)]
Merge pull request #5865 from slankdev/slankdev-zebra-srv6-manager

zebra: srv6 manager

3 years agozebra: fix config after exit from vrf
Igor Ryzhov [Wed, 2 Jun 2021 14:27:02 +0000 (17:27 +0300)]
zebra: fix config after exit from vrf

When the VRF node is exited using "exit" or "quit", there's still a VRF
pointer stored in the vty context. If you try to configure some router
related command, it will be applied to the previous VRF instead of the
default VRF. For example:

```
(config)# vrf test
(config-vrf)# ip router-id 1.1.1.1
(config-vrf)# do show run
...
!
vrf test
 ip router-id 1.1.1.1
 exit-vrf
!
...
(config-vrf)# exit
(config)# ip router-id 2.2.2.2
(config)# do show run
...
!
vrf test
 ip router-id 2.2.2.2
 exit-vrf
!
...
```

`vrf-exit` works correctly, because it stores a pointer to the default
VRF into the vty context (but weirdly keeping the VRF_NODE instead of
changing it to CONFIG_NODE).

Instead of relying on the behavior of exit function, always use the
default VRF when in CONFIG_NODE.

Another problem is missing `VTY_CHECK_CONTEXT`. If someone deletes the
VRF in which node the user enters the command, then zebra applies the
command to the default VRF instead of throwing an error.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoospfd, doc, tests: combined SRGB/SRLB command
Emanuele Di Pascale [Thu, 27 May 2021 12:37:48 +0000 (14:37 +0200)]
ospfd, doc, tests: combined SRGB/SRLB command

similarly to what was done for IS-IS in commit 01d43141, combine
the SRGB and SRLB commands for OSPF-SR, so that we can replace
overlapping ranges in one sweep change.

Also allow the range configuration to be stored before SR is enabled.
There is no reason why we should not - in fact that constraint meant
that we were always requesting the default label ranges regardless
of what we actually wanted to use.

Finally, update the topotests now that we do not need to refresh
the SRGB/SRLB/MSD after disabling SR. Note that the prefix-sid still
needs to be re-added.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
3 years agoMerge pull request #8779 from idryzhov/zebra-rst
Mark Stapp [Fri, 4 Jun 2021 14:38:09 +0000 (10:38 -0400)]
Merge pull request #8779 from idryzhov/zebra-rst

Zebra doc fixes

3 years agoMerge pull request #8772 from idryzhov/bfd-key-packed
Rafael Zalamena [Fri, 4 Jun 2021 13:42:21 +0000 (10:42 -0300)]
Merge pull request #8772 from idryzhov/bfd-key-packed

bfdd: fix bfd key structure

3 years agoMerge pull request #8783 from idryzhov/doc-varname
Donatas Abraitis [Fri, 4 Jun 2021 12:32:10 +0000 (15:32 +0300)]
Merge pull request #8783 from idryzhov/doc-varname

doc: remove varnames from command descriptions

3 years agotopotests: OSPFv3 NSSA test LSA type 7
Rafael Zalamena [Sun, 30 May 2021 15:49:19 +0000 (12:49 -0300)]
topotests: OSPFv3 NSSA test LSA type 7

New OSPFv3 NSSA test:
 * When a static route is redistributed to an NSSA router it should be
   type 7 and should show up in OSPFv3 route database.
 * Test LSA Type 7 and route removal.

Co-authored-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agotopotests: add tests for OSPFv3 NSSA/Stub
Kaushik [Thu, 25 Mar 2021 11:43:15 +0000 (04:43 -0700)]
topotests: add tests for OSPFv3 NSSA/Stub

New test verification:
 * Stub and NSSA areas contain no external routes

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agoospf6d: missing NSSA areas handling
Rafael Zalamena [Sun, 30 May 2021 13:46:06 +0000 (10:46 -0300)]
ospf6d: missing NSSA areas handling

Patch provided by Soman K.S. with small alterations.

Signed-off-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
3 years agodoc: OSPFv3 NSSA command document
Kaushik [Thu, 25 Mar 2021 11:38:54 +0000 (04:38 -0700)]
doc: OSPFv3 NSSA command document

Document added for ospfv3 nssa command.

Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoospf6d: support for nssa in ospfv3
Kaushik [Thu, 25 Mar 2021 15:43:26 +0000 (08:43 -0700)]
ospf6d: support for nssa in ospfv3

Fix for the routes which is not classified as best routes.

Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoospf6d: Support for nssa in ospfv3
Kaushik [Thu, 25 Mar 2021 11:29:51 +0000 (04:29 -0700)]
ospf6d: Support for nssa in ospfv3

The following is implemented.
1. Configuring area as NSSA.
2. Generating Type 7 LSA.
3. Conversion of Type 7 to Type 5 ( Default Behavior).
4. NSSA ABR selection.

Reviewed-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Co-authored-by: Kaushik <kaushiknath.null@gmail.com>
Co-authored-by: Soman K.S <somanks@gmail.com>
Signed-off-by: Kaushik <kaushiknath.null@gmail.com>
3 years agoMerge pull request #8776 from anlancs/fix-ospf-cli-passive-interface
Igor Ryzhov [Fri, 4 Jun 2021 08:06:51 +0000 (11:06 +0300)]
Merge pull request #8776 from anlancs/fix-ospf-cli-passive-interface

ospfd: remove ospf interface config: passive-interface

3 years agodoc: use add_css_file(); not deprecated
Quentin Young [Thu, 3 Jun 2021 17:41:13 +0000 (13:41 -0400)]
doc: use add_css_file(); not deprecated

add_stylesheet() is deprecated and removed in Sphinx 4.x

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agodoc: add requirements.txt
Quentin Young [Thu, 3 Jun 2021 17:35:34 +0000 (13:35 -0400)]
doc: add requirements.txt

Add a minimum sphinx version requirement for the docs; RTD needs this to
know what version of sphinx to install.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
3 years agoMerge pull request #8771 from volta-networks/fix_pathd_bandwidth
Renato Westphal [Thu, 3 Jun 2021 14:33:56 +0000 (11:33 -0300)]
Merge pull request #8771 from volta-networks/fix_pathd_bandwidth

pathd: fix render candidate-path bandwidth

3 years agoospfd: if destroy the whole ospf, then remove ospf's interface config: passive-interface
anlancs [Wed, 2 Jun 2021 02:51:49 +0000 (10:51 +0800)]
ospfd: if destroy the whole ospf, then remove ospf's interface config: passive-interface

Signed-off-by: anlancs <anlan_cs@tom.com>
3 years agodoc: remove varnames from command descriptions
Igor Ryzhov [Wed, 2 Jun 2021 23:19:36 +0000 (02:19 +0300)]
doc: remove varnames from command descriptions

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib: fix output of "list" and "find" commands
Igor Ryzhov [Wed, 2 Jun 2021 23:02:45 +0000 (02:02 +0300)]
lib: fix output of "list" and "find" commands

Currently, we output the command exactly how it is defined in DEFUN.
We shouldn't output varnames and excessive whitespace.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agolib, vtysh: reduce code duplication
Igor Ryzhov [Wed, 2 Jun 2021 21:29:51 +0000 (00:29 +0300)]
lib, vtysh: reduce code duplication

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agoMerge pull request #8210 from LabNConsulting/chopps/always-batch
Donald Sharp [Wed, 2 Jun 2021 22:13:42 +0000 (18:13 -0400)]
Merge pull request #8210 from LabNConsulting/chopps/always-batch

northbound: KISS always batch yang config, it's faster.

3 years agobfdd: fix bfd key structure
Igor Ryzhov [Tue, 1 Jun 2021 17:30:13 +0000 (20:30 +0300)]
bfdd: fix bfd key structure

There's a padding byte between "mhop" and "peer" fields in this structure.
This structure is sometimes passed by value to functions and used in
assignments. The standard doesn't guarantee that the padding bytes are
copied on assignments. As this structure is used as a hash key, having
this padding byte with unspecified value can lead to unwanted behavior.

Fix the possible issue by making the "mhop" field to be 2 bytes. Also
make the struct packed as a precaution for future changes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: add separate section for nexthop tracking
Igor Ryzhov [Wed, 2 Jun 2021 14:51:09 +0000 (17:51 +0300)]
doc: add separate section for nexthop tracking

"ip nht resolve-via-default" is currently placed in "Link Parameters
Commands" section. Add a separate section and missing IPv6 counterpart.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agodoc: fix link-params commands
Igor Ryzhov [Wed, 2 Jun 2021 14:39:26 +0000 (17:39 +0300)]
doc: fix link-params commands

Remove redundant prefix.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agobgpd,sharpd,zebra: fix code style
Hiroki Shirokura [Wed, 5 May 2021 10:37:55 +0000 (10:37 +0000)]
bgpd,sharpd,zebra: fix code style

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*
Hiroki Shirokura [Fri, 23 Apr 2021 12:46:07 +0000 (12:46 +0000)]
*: delete ZEBRA_FLAG_SEG6*_ROUTE and add ZAPI_NEXTHOP_FLAG_SEG6*

https://github.com/FRRouting/frr/pull/5865#discussion_r597670225

As this comment says. ZEBRA_FLAG_XXX should not have been used.
To communicate SRv6 Route Information. A simple Nexthop Flag would
have been sufficient for SRv6 information. And I fixed the whole
thing that way.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: early return on seg6local nlmsg crafting
Hiroki Shirokura [Fri, 23 Apr 2021 11:27:41 +0000 (11:27 +0000)]
zebra: early return on seg6local nlmsg crafting

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib,sharpd,zebra: update nexthop object with nh_srv6
Hiroki Shirokura [Mon, 5 Apr 2021 13:29:12 +0000 (13:29 +0000)]
lib,sharpd,zebra: update nexthop object with nh_srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agodoc: update srv6 cli guide
Hiroki Shirokura [Sat, 3 Apr 2021 17:33:06 +0000 (17:33 +0000)]
doc: update srv6 cli guide

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agotests: update sharpd srv6 route command
Hiroki Shirokura [Fri, 2 Apr 2021 12:12:46 +0000 (12:12 +0000)]
tests: update sharpd srv6 route command

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agosharpd: split srv6 route install command
Hiroki Shirokura [Fri, 2 Apr 2021 12:12:20 +0000 (12:12 +0000)]
sharpd: split srv6 route install command

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fill_seg6ipt_encap func with boundary check
Hiroki Shirokura [Mon, 22 Mar 2021 13:58:20 +0000 (13:58 +0000)]
zebra: fill_seg6ipt_encap func with boundary check

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agosharpd: follow the practice on cli design for json output
Hiroki Shirokura [Mon, 22 Mar 2021 11:32:09 +0000 (11:32 +0000)]
sharpd: follow the practice on cli design for json output

The "show sharp segment-routing srv6" command was a
json output command, but it did not follow the common
practice of the other commands.

It follows the review and outputs the json format by
using the json keyword. Otherwise, it produces human
readable output.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: error check for nl_attr_xxx
Hiroki Shirokura [Mon, 22 Mar 2021 10:36:17 +0000 (10:36 +0000)]
zebra: error check for nl_attr_xxx

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: use const on fill_seg6ipt_encap func
Hiroki Shirokura [Mon, 22 Mar 2021 09:48:04 +0000 (09:48 +0000)]
zebra: use const on fill_seg6ipt_encap func

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix implicit conversion
Hiroki Shirokura [Mon, 22 Mar 2021 09:28:32 +0000 (09:28 +0000)]
zebra: fix implicit conversion

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: eliminate redundant info from srv6 locator zapi
Hiroki Shirokura [Mon, 22 Mar 2021 09:07:18 +0000 (09:07 +0000)]
*: eliminate redundant info from srv6 locator zapi

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agotests: fix json style on srv6_locator test
Hiroki Shirokura [Mon, 22 Mar 2021 08:23:08 +0000 (08:23 +0000)]
tests: fix json style on srv6_locator test

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: drop un-needed info in locator-zapi
Hiroki Shirokura [Mon, 22 Mar 2021 02:24:06 +0000 (02:24 +0000)]
zebra: drop un-needed info in locator-zapi

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: delete unneeded zebra_srv6_manager_connect
Hiroki Shirokura [Mon, 22 Mar 2021 01:45:33 +0000 (01:45 +0000)]
zebra: delete unneeded zebra_srv6_manager_connect

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: erase wrong comments by copy-paste
Hiroki Shirokura [Mon, 22 Mar 2021 01:09:16 +0000 (01:09 +0000)]
lib: erase wrong comments by copy-paste

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: eliminate odd line-break
Hiroki Shirokura [Mon, 22 Mar 2021 00:57:03 +0000 (00:57 +0000)]
lib: eliminate odd line-break

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: integrate srv6-nexthop-cmp functions
Hiroki Shirokura [Mon, 22 Mar 2021 00:52:11 +0000 (00:52 +0000)]
lib: integrate srv6-nexthop-cmp functions

I agree with the PR review from mstap and merged
the following two functions into one.

- zapi_nexthop_seg6_cmp
- zapi_nexthop_seg6local_cmp

[note]
If both of them have more complex extensions in the future,
I think it will be less confusing to remove the integration
of these functions and make them as separate functions as
before.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: use one line init instead of memset and format it
Hiroki Shirokura [Mon, 22 Mar 2021 00:31:56 +0000 (00:31 +0000)]
*: use one line init instead of memset and format it

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agolib: fix json style to camel-case instead of underscores
Hiroki Shirokura [Mon, 22 Mar 2021 00:04:06 +0000 (00:04 +0000)]
lib: fix json style to camel-case instead of underscores

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix typo
Hiroki Shirokura [Mon, 8 Mar 2021 15:05:49 +0000 (15:05 +0000)]
zebra: fix typo

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix build error for NetBSD8
Hiroki Shirokura [Wed, 24 Feb 2021 11:52:30 +0000 (11:52 +0000)]
bgpd: fix build error for NetBSD8

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix Dereference of null pointer
Hiroki Shirokura [Wed, 24 Feb 2021 11:28:59 +0000 (11:28 +0000)]
zebra: fix Dereference of null pointer

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: fix code format accourding to checkpatch
Hiroki Shirokura [Wed, 24 Feb 2021 09:36:09 +0000 (09:36 +0000)]
*: fix code format accourding to checkpatch

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: ignore nexthop validation for srv6-vpn
Hiroki Shirokura [Tue, 9 Feb 2021 05:26:22 +0000 (05:26 +0000)]
bgpd: ignore nexthop validation for srv6-vpn

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: use zapi_srv6_locator_chunk_decode
Hiroki Shirokura [Thu, 31 Dec 2020 11:57:03 +0000 (11:57 +0000)]
bgpd: use zapi_srv6_locator_chunk_decode

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: add zapi_srv6_locator_chunk_{en,de}code
Hiroki Shirokura [Thu, 31 Dec 2020 11:56:32 +0000 (11:56 +0000)]
zebra: add zapi_srv6_locator_chunk_{en,de}code

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agodoc: fix srv6 section according to review
Hiroki Shirokura [Wed, 30 Dec 2020 02:16:44 +0000 (02:16 +0000)]
doc: fix srv6 section according to review

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix vrf route-leaking crash around srv6
Hiroki Shirokura [Wed, 30 Dec 2020 01:19:20 +0000 (01:19 +0000)]
bgpd: fix vrf route-leaking crash around srv6

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix compile error for BSD platforms
Hiroki Shirokura [Tue, 29 Dec 2020 10:56:38 +0000 (10:56 +0000)]
bgpd: fix compile error for BSD platforms

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: fix compile error of missing-braces
Hiroki Shirokura [Tue, 29 Dec 2020 10:55:50 +0000 (10:55 +0000)]
zebra: fix compile error of missing-braces

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: fix crash when bgp_delete found by unit-test
Hiroki Shirokura [Tue, 29 Dec 2020 08:23:34 +0000 (08:23 +0000)]
bgpd: fix crash when bgp_delete found by unit-test

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agozebra: rewrite locator_prefix_cmd with DEFPY
Hiroki Shirokura [Tue, 29 Dec 2020 07:30:47 +0000 (07:30 +0000)]
zebra: rewrite locator_prefix_cmd with DEFPY

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years ago*: fix code format accourding to checkpatch
Hiroki Shirokura [Wed, 24 Feb 2021 10:10:06 +0000 (10:10 +0000)]
*: fix code format accourding to checkpatch

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agotopotests: bgp_srv6l3vpn_to_bgp_vrf (step4)
Hiroki Shirokura [Fri, 18 Dec 2020 23:40:22 +0000 (08:40 +0900)]
topotests: bgp_srv6l3vpn_to_bgp_vrf (step4)

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: install vpn's transit route using H.Encaps (step4)
Hiroki Shirokura [Fri, 18 Dec 2020 22:53:03 +0000 (07:53 +0900)]
bgpd: install vpn's transit route using H.Encaps (step4)

This commit make bgpd to support install H.Encaps(seg6 mode segs) routes
when VPN-prefix has Prefix-sid.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: advertising vpn-rib include SRv6-SID (step4)
Hiroki Shirokura [Sat, 19 Dec 2020 02:07:16 +0000 (11:07 +0900)]
bgpd: advertising vpn-rib include SRv6-SID (step4)

This commit make bgpd to support VPN SID advertisement
as BGP Prefix-SID when route-leaking from BGP-vrf instance
to BGP-vpn instance.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: cli for checking srv6 information (step4)
Hiroki Shirokura [Sat, 19 Dec 2020 01:14:08 +0000 (10:14 +0900)]
bgpd: cli for checking srv6 information (step4)

This commit add cli to check bgp's srv6 status
which is srv6-locator name and its locator-chunks
for bgpd. And this command also can be used to
check tovpn_sid for each bgp instances.

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>
3 years agobgpd: cli for SRv6 SID alloc to redirect to vrf (step4)
Hiroki Shirokura [Sat, 19 Dec 2020 02:04:40 +0000 (11:04 +0900)]
bgpd: cli for SRv6 SID alloc to redirect to vrf (step4)

This commit add cil to configure BGP SRv6-VPN sid allocation.
Almost mechanism are based on BGP MPLS-VPN.

User can allocate and export sid with using following config.
Then bgpd try to allocate new SID to redirect vpn to vrf using
SRv6 localsid End.DT4/DT6. Currently linux kernel will regect
End.DT4 route install due to no-implementation.
(at-least today's FRR's ci kernel.)

So now we only supports BGP SRv6-VPNv6.

router bgp 1
 segment-routing srv6
  locator loc1
 !
 address-family ipv6 vpn
 exit-address-family
!
router bgp 1 vrf vrf10
 address-family ipv6 unicast
  sid vpn export 1    !!(option1)!!
  sid vpn export auto !!(option2)!!
 exit-address-family
!

Signed-off-by: Hiroki Shirokura <slank.dev@gmail.com>