]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
3 years agoMerge pull request #10318 from donaldsharp/redistribution
Russ White [Mon, 24 Jan 2022 03:30:24 +0000 (22:30 -0500)]
Merge pull request #10318 from donaldsharp/redistribution

OSPF Redistribution

3 years agoMerge pull request #10352 from ton31337/fix/autocomplete_neighbor_peergroup
Russ White [Mon, 24 Jan 2022 03:29:44 +0000 (22:29 -0500)]
Merge pull request #10352 from ton31337/fix/autocomplete_neighbor_peergroup

bgpd: Add peer-groups to neighbor autocomplete

3 years agoMerge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2
Russ White [Mon, 24 Jan 2022 03:28:34 +0000 (22:28 -0500)]
Merge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2

bgpd: Graceful-restart / LLGR with dynamic peers

3 years agoMerge pull request #10398 from patrasar/pim_debug_fix
Quentin Young [Fri, 21 Jan 2022 19:08:48 +0000 (14:08 -0500)]
Merge pull request #10398 from patrasar/pim_debug_fix

3 years agoMerge pull request #8011 from donaldsharp/starvation
Jafar Al-Gharaibeh [Fri, 21 Jan 2022 15:01:42 +0000 (09:01 -0600)]
Merge pull request #8011 from donaldsharp/starvation

lib: Figure out if we are being starved for cpu

3 years agopimd: debug pim fixes 10398/head
sarita patra [Fri, 21 Jan 2022 11:02:16 +0000 (03:02 -0800)]
pimd: debug pim fixes

Enable debug commands "debug pim packetdump send" and
"debug pim packetdump receive" in config mode.

Display "debug pim nht rp" in show running config.

Signed-off-by: sarita patra <saritap@vmware.com>
3 years agoMerge pull request #10392 from pguibert6WIND/isis_vrf_change
Igor Ryzhov [Thu, 20 Jan 2022 17:47:33 +0000 (20:47 +0300)]
Merge pull request #10392 from pguibert6WIND/isis_vrf_change

3 years agolib, zebra: Add ability to tell thread system to ignore late timers 8011/head
Donald Sharp [Wed, 19 Jan 2022 19:56:25 +0000 (14:56 -0500)]
lib, zebra: Add ability to tell thread system to ignore late timers

Add a thread_ignore_late_timer(struct thread *thread) function
that allows thread.c to ignore when timers are late to the party.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agolib: Figure out if we are being starved for cpu
Donald Sharp [Wed, 3 Feb 2021 14:13:59 +0000 (09:13 -0500)]
lib: Figure out if we are being starved for cpu

If a thread timer should have popped CPU_CONSUMED_CHECK
seconds in the past, and we are only handling it now.  Consider
the thread starved and notice it.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotopotests: isis vrf config changed 10392/head
Philippe Guibert [Thu, 20 Jan 2022 15:07:22 +0000 (16:07 +0100)]
topotests: isis vrf config changed

Use vrf keyword for interface, and directly configure isis under
that interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
3 years agoMerge pull request #10360 from opensourcerouting/clippy-rel-endian 10371/head
Mark Stapp [Wed, 19 Jan 2022 13:58:12 +0000 (08:58 -0500)]
Merge pull request #10360 from opensourcerouting/clippy-rel-endian

lib/clippy: don't endian-convert twice

3 years agotests: Lower keepalive/hold/connect timers for BGP LLGR test 10348/head
Donatas Abraitis [Tue, 18 Jan 2022 09:47:27 +0000 (11:47 +0200)]
tests: Lower keepalive/hold/connect timers for BGP LLGR test

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Print function name for `(dynamic neighbor) deleted` debug messages
Donatas Abraitis [Sat, 15 Jan 2022 21:44:26 +0000 (23:44 +0200)]
bgpd: Print function name for `(dynamic neighbor) deleted` debug messages

Just sometimes to properly understand where this is coming from.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agotests: Check if LLGR works with dynamic peers as well
Donatas Abraitis [Sat, 15 Jan 2022 21:38:00 +0000 (23:38 +0200)]
tests: Check if LLGR works with dynamic peers as well

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Do not delete BGP dynamic peers if graceful restart kicks in
Donatas Abraitis [Sat, 15 Jan 2022 21:16:15 +0000 (23:16 +0200)]
bgpd: Do not delete BGP dynamic peers if graceful restart kicks in

```
~# vtysh -c 'show bgp ipv4 unicast summary' | grep 192.168.10.17
*donatas-pc(192.168.10.17)           4      65002         8        12        0    0    0 00:01:35            2       14 N/A
```

Before shutting down 192.168.10.17:

```
~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32'
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Last update: Sat Jan 15 21:45:47 2022
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (Older Path)
      Last update: Sat Jan 15 21:25:19 2022
```

After 192.168.10.17 is down:

```
~# vtysh -c 'show bgp ipv4 unicast summary' | grep 192.168.10.17
donatas-pc(192.168.10.17)            4      65002         5         9        0    0    0 00:00:12       Active        0 N/A

~# vtysh -c 'show bgp ipv4 unicast 100.100.100.100/32'
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Community: llgr-stale
      Last update: Sat Jan 15 21:49:01 2022
      Time until Long-lived stale route deleted: 16
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Last update: Sat Jan 15 21:25:19 2022
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #10362 from mobash-rasool/fixes
Stephen Worley [Wed, 19 Jan 2022 05:39:17 +0000 (00:39 -0500)]
Merge pull request #10362 from mobash-rasool/fixes

pimd: remove redundant header include

3 years agoMerge pull request #10363 from anlancs/bfd-move-counter
Santosh P K [Wed, 19 Jan 2022 05:34:28 +0000 (11:04 +0530)]
Merge pull request #10363 from anlancs/bfd-move-counter

bfdd: fix the possibly wrong counter of control packets

3 years agoMerge pull request #10369 from donaldsharp/isis_fixes
Santosh P K [Wed, 19 Jan 2022 05:23:47 +0000 (10:53 +0530)]
Merge pull request #10369 from donaldsharp/isis_fixes

Isis fixes

3 years agoMerge pull request #10351 from mobash-rasool/topotest-ci-fix
Stephen Worley [Tue, 18 Jan 2022 21:47:39 +0000 (16:47 -0500)]
Merge pull request #10351 from mobash-rasool/topotest-ci-fix

tests: Fix random failure in test_PIM_hello_tx_rx_p1

3 years agoisisd: Ensure structure is defined for compilation 10369/head
Donald Sharp [Tue, 18 Jan 2022 19:07:21 +0000 (14:07 -0500)]
isisd: Ensure structure is defined for compilation

lib/zclient.h was missing from #includes so compiler
was rightly complaining about undefined structure.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoisisd: Log messages should not have newlines in them.
Donald Sharp [Tue, 18 Jan 2022 19:06:38 +0000 (14:06 -0500)]
isisd: Log messages should not have newlines in them.

Fixes the compile failing because log messages were introduced
with newlines where in them.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoMerge pull request #10355 from opensourcerouting/noisy-startup
Russ White [Tue, 18 Jan 2022 16:30:13 +0000 (11:30 -0500)]
Merge pull request #10355 from opensourcerouting/noisy-startup

lib, zebra: make startup less noisy

3 years agoMerge pull request #9938 from Orange-OpenSource/isis_ls
Russ White [Tue, 18 Jan 2022 15:12:08 +0000 (10:12 -0500)]
Merge pull request #9938 from Orange-OpenSource/isis_ls

isisd: Add Link State Traffic Engineering support

3 years agoMerge pull request #9644 from opensourcerouting/ospf-opaque-attrs
Russ White [Tue, 18 Jan 2022 14:08:38 +0000 (09:08 -0500)]
Merge pull request #9644 from opensourcerouting/ospf-opaque-attrs

OSPF opaque route attributes

3 years agozebra: Add table and instance data to debugs for redistribute_delete 10318/head
Donald Sharp [Fri, 14 Jan 2022 18:16:17 +0000 (13:16 -0500)]
zebra: Add table and instance data to debugs for redistribute_delete

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Cleanup temp variable usage in debugs for %pFX
Donald Sharp [Fri, 14 Jan 2022 17:59:50 +0000 (12:59 -0500)]
zebra: Cleanup temp variable usage in debugs for %pFX

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Use %pRN instead of %pFX whenver possible
Donald Sharp [Fri, 14 Jan 2022 17:55:48 +0000 (12:55 -0500)]
zebra: Use %pRN instead of %pFX whenver possible

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Modify route_notify_internal to use a route_node
Donald Sharp [Fri, 14 Jan 2022 17:50:51 +0000 (12:50 -0500)]
zebra: Modify route_notify_internal to use a route_node

Pass in the route_node that is under consideration
into route_notify_internal to allow calling functions
to reduce stack size as well as looking up data.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Cleanup %pFX to %pRN in rib_process_result
Donald Sharp [Fri, 14 Jan 2022 17:40:53 +0000 (12:40 -0500)]
zebra: Cleanup %pFX to %pRN in rib_process_result

The dest_pfx was pretty much only ever used for
debug output and FRR already knows the rn.  So
use that instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Reduce unneeded lookup in rib_process
Donald Sharp [Fri, 14 Jan 2022 17:37:23 +0000 (12:37 -0500)]
zebra: Reduce unneeded lookup in rib_process

the lookup of the src_p and dest_p is not needed
since the values are never used.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Reduce lookups in rib_process_dplane_notify
Donald Sharp [Fri, 14 Jan 2022 17:35:46 +0000 (12:35 -0500)]
zebra: Reduce lookups in rib_process_dplane_notify

the dest_p and src_p values were only ever used for
debugs and %pFX, when we already have the rn.
There is no need to do this lookup

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Fix redistribute.h up to our standards
Donald Sharp [Fri, 14 Jan 2022 16:30:31 +0000 (11:30 -0500)]
zebra: Fix redistribute.h up to our standards

FRR must give variable names instead of not defining
them in the .h file.  This just cleans up this
problem for redistribute.h

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Modify zsend_redistribute_route to receive struct route_node
Donald Sharp [Fri, 14 Jan 2022 16:26:51 +0000 (11:26 -0500)]
zebra: Modify zsend_redistribute_route to receive struct route_node

The function zsend_redistribute_route uses the prefix and
source prefix.  Just pass in the route_node instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Pass rn to zebra_redistribute_check instead
Donald Sharp [Fri, 14 Jan 2022 16:18:48 +0000 (11:18 -0500)]
zebra: Pass rn to zebra_redistribute_check instead

FRR is using struct prefix and afi to be passed
around.  When all that is needed is the route node.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Convert redistribute_update to use a route_node
Donald Sharp [Fri, 14 Jan 2022 15:00:01 +0000 (10:00 -0500)]
zebra: Convert redistribute_update to use a route_node

FRR is passing around a bunch of data that is encapsulated
within the route node.  Let's just pass that around instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Convert redistribute_delete to use a route_node
Donald Sharp [Fri, 14 Jan 2022 14:48:00 +0000 (09:48 -0500)]
zebra: Convert redistribute_delete to use a route_node

FRR is passing around a bunch of data that is encapsulated
within the route node.  Let's just pass that around instead.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agotests: Add ospf_instance_redistribute testing
Donald Sharp [Tue, 4 Jan 2022 18:11:35 +0000 (13:11 -0500)]
tests: Add ospf_instance_redistribute testing

Redistribution for ospf with instance id's using instance id's
was incorrect.  Add some small tests to make sure it catches the
issues and we don't regress.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Do not allow instance redistribution to happen no matter what
Donald Sharp [Tue, 4 Jan 2022 11:57:53 +0000 (06:57 -0500)]
zebra: Do not allow instance redistribution to happen no matter what

If you have this setup:

router ospf 3
  redistribute sharp
!

and then install:
sharp install route 4.5.6.7 nexthop 192.168.100.1 1
sharp install route 4.5.6.8 nexthop 192.168.100.1 1 instance 3
sharp install route 4.5.6.9 nexthop 192.168.100.1 1 instance 4

The .8 and .9 routes are auto redistributed into ospf instance 3:

eva# show ip ospf data

OSPF Instance: 3

       OSPF Router with ID (192.168.122.1)

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
4.5.6.7        192.168.122.1     13 0x80000001 0x477c E2 4.5.6.7/32 [0x0]
4.5.6.8        192.168.122.1      5 0x80000001 0x3d85 E2 4.5.6.8/32 [0x0]
4.5.6.9        192.168.122.1      5 0x80000001 0x338e E2 4.5.6.9/32 [0x0]

This cannot be correct behavior.  When redistributing in the absense
of an instance number the default instance of 0 should be used and should
be the only route redistributed.  Here is the correct behavior:

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:00:28
D>* 4.5.6.7/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
D[3]>* 4.5.6.8/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
D[4]>* 4.5.6.9/32 [150/0] via 192.168.100.1, virbr1, weight 1, 00:00:02
C>* 192.168.100.0/24 is directly connected, virbr1, 00:00:28
C>* 192.168.110.0/24 is directly connected, virbr2, 00:00:28
C>* 192.168.119.0/24 is directly connected, enp39s0, 00:00:28
C>* 192.168.122.0/24 is directly connected, virbr0, 00:00:28
eva# show ip ospf data

OSPF Instance: 3

       OSPF Router with ID (192.168.122.1)

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
4.5.6.7        192.168.122.1      6 0x80000001 0x477c E2 4.5.6.7/32 [0x0]

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Get `default-information originate` working for ospf instances
Donald Sharp [Mon, 3 Jan 2022 17:15:02 +0000 (12:15 -0500)]
ospfd: Get `default-information originate` working for ospf instances

The ospf instance code is not properly handling the default route
when using default-information originate.  This is because
the code is looking for the default route to be saved with an
instance of <ospf instance id> but we always save it as a instance
id of 0.  In fact OSPF asks zebra for the default route as a special
case in instance 0, always.

Here is the correct behavior:

eva# show ip ospf data

OSPF Instance: 3

       OSPF Router with ID (192.168.122.1)

                AS External Link States

Link ID         ADV Router      Age  Seq#       CkSum  Route
0.0.0.0        192.168.122.1      8 0x80000001 0xdb08 E2 0.0.0.0/0 [0x0]

eva# show ip route
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp39s0, 00:02:03

Fixes: #10251
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agoospfd: Add counts of lsa types to summary command
Donald Sharp [Tue, 11 Jan 2022 15:02:33 +0000 (10:02 -0500)]
ospfd: Add counts of lsa types to summary command

Add the ability to know the number of lsa type's we
hold in the database as part of the json output.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agozebra: Add hint to what instance we are looking at
Donald Sharp [Mon, 3 Jan 2022 17:11:37 +0000 (12:11 -0500)]
zebra: Add hint to what instance we are looking at

FRR allows redistribution to a client with a specific
instance in mind.  The code was not allowing you to figure
out what instance was being looked at.  So let's clarify this
in the debugs.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
3 years agopimd: remove redundant header include 10362/head
Mobashshera Rasool [Tue, 18 Jan 2022 12:35:37 +0000 (04:35 -0800)]
pimd: remove redundant header include

Removing redundant header inclusion of pim_cmd.h

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agoMerge pull request #10276 from patrasar/mld_northbound
David Lamparter [Tue, 18 Jan 2022 10:20:28 +0000 (11:20 +0100)]
Merge pull request #10276 from patrasar/mld_northbound

3 years agobfdd: fix the possibly wrong counter of control packets 10363/head
anlan_cs [Tue, 18 Jan 2022 10:00:45 +0000 (05:00 -0500)]
bfdd: fix the possibly wrong counter of control packets

Since control packets may be dropped by ttl check, the counter
operation should be put after all check including ttl check.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
3 years agolib/clippy: don't endian-convert twice 10360/head
David Lamparter [Tue, 18 Jan 2022 08:50:25 +0000 (09:50 +0100)]
lib/clippy: don't endian-convert twice

elf_getdata_rawchunk() already endian-converts; doing it again is, uh,
counterproductive.

Fixes: #10051
Reported-by: Lucian Cristian <lucian.cristian@gmail.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agobgpd: List peer-group as neighbor once and not for IPv4/IPv6/WORD 10352/head
Donatas Abraitis [Mon, 17 Jan 2022 14:52:06 +0000 (16:52 +0200)]
bgpd: List peer-group as neighbor once and not for IPv4/IPv6/WORD

Before:

```
exit1-debian-11(config-router)# neighbor ?
  A.B.C.D   Neighbor address
     192.168.0.2 PEER PG
  WORD      Interface name or neighbor tag
     PEER PG
  X:X::X:X  Neighbor IPv6 address
     2a02:abc::17 2a02:bbd::2 PEER PG
```

After:

```
exit1-debian-11(config-router)# neighbor ?
  A.B.C.D   Neighbor address
     192.168.0.2
  WORD      Interface name or neighbor tag
     PEER PG
  X:X::X:X  Neighbor IPv6 address
     2a02:abc::17 2a02:bbd::2
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #10358 from idryzhov/workflow-pr-cleanup
Donatas Abraitis [Tue, 18 Jan 2022 08:48:30 +0000 (10:48 +0200)]
Merge pull request #10358 from idryzhov/workflow-pr-cleanup

doc: cleanup submitting patches and enhancements

3 years agodoc: cleanup submitting patches and enhancements 10358/head
Igor Ryzhov [Mon, 17 Jan 2022 17:21:08 +0000 (20:21 +0300)]
doc: cleanup submitting patches and enhancements

Remove some remains from the times when patches were accepted via email.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
3 years agopim: Keeping list of address-family under gmp container 10276/head
sarita patra [Tue, 4 Jan 2022 11:26:06 +0000 (03:26 -0800)]
pim: Keeping list of address-family under gmp container

Renamed frr-igmp.yang to frr-gmp.yang, igmp to gmp container.
to support IGMP and MLD protocol.

frr-gmp.yang, created a list of address family under mgmd
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.

This commit will have all the northbound changes to support
IPV4 address family.

Signed-off-by: sarita patra <saritap@vmware.com>
3 years agoMerge pull request #10179 from patrasar/pimv6_northbound
David Lamparter [Mon, 17 Jan 2022 12:23:21 +0000 (13:23 +0100)]
Merge pull request #10179 from patrasar/pimv6_northbound

3 years agoMerge pull request #10183 from idryzhov/rework-vrf-rename
Rafael Zalamena [Mon, 17 Jan 2022 11:45:12 +0000 (08:45 -0300)]
Merge pull request #10183 from idryzhov/rework-vrf-rename

*: rework renaming the default VRF

3 years agozebra: remove netlink buffer size log message 10355/head
David Lamparter [Sun, 16 Jan 2022 21:26:45 +0000 (22:26 +0100)]
zebra: remove netlink buffer size log message

... really not much point in printing this.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: avoid pointless search for built-in IETF YANG
David Lamparter [Sun, 16 Jan 2022 21:24:40 +0000 (22:24 +0100)]
lib: avoid pointless search for built-in IETF YANG

This causes confusing/annoying log messages at startup otherwise:
`YANG model "ietf-inet-types@*" "*@*"not embedded, trying external file`

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #10350 from Drumato/fix-zebra-srv6-segment-routing-block
Igor Ryzhov [Mon, 17 Jan 2022 03:33:17 +0000 (06:33 +0300)]
Merge pull request #10350 from Drumato/fix-zebra-srv6-segment-routing-block

3 years agobgpd: Add peer-groups to neighbor autocomplete
Donatas Abraitis [Sun, 16 Jan 2022 20:01:47 +0000 (22:01 +0200)]
bgpd: Add peer-groups to neighbor autocomplete

```
exit1-debian-11(config-router)# neighbor PGTEST peer-group
exit1-debian-11(config-router)# neighbor PEER peer-group
exit1-debian-11(config-router)# neighbor ?
  A.B.C.D   Neighbor address
     192.168.0.2 PEER PGTEST
  WORD      Interface name or neighbor tag
     PEER PGTEST
  X:X::X:X  Neighbor IPv6 address
     2a02:abc::17 2a02:bbd::2 PEER PGTEST
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agozebra: fix `segment-routing` command not found error with `--disable-pathd` 10350/head
Yamato Sugawara [Sun, 16 Jan 2022 04:08:47 +0000 (04:08 +0000)]
zebra: fix `segment-routing` command not found error with `--disable-pathd`

Signed-off-by: Yamato Sugawara <yamato.sugawara@linecorp.com>
3 years agoMerge pull request #10349 from anlancs/doc-ospf-no
Igor Ryzhov [Sun, 16 Jan 2022 12:31:04 +0000 (15:31 +0300)]
Merge pull request #10349 from anlancs/doc-ospf-no

doc: adjust small words for ospfd

3 years agotests: Fix random failure in test_PIM_hello_tx_rx_p1 10351/head
Mobashshera Rasool [Sun, 16 Jan 2022 08:25:23 +0000 (00:25 -0800)]
tests: Fix random failure in test_PIM_hello_tx_rx_p1

The test case test_PIM_hello_tx_rx_p1 is failing randomly because
sometimes the hello packet is received and sometimes not received while getting
the stats data.
When the hello packet is received HelloRx gets incremented to 1 and then
shutdown of the interface is executed which resets the stats to 0
and again when "no shutdown" of the interface is done, the stats get incremented to 1.
The test case checks after "no shutdown" of the interface whether the stats is incremented
but in this case although the stats got incremented the before and after value is same.
Hence the test case failed.

Adding correct expectations in the test case.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agodoc: adjust small words for ospfd 10349/head
anlan_cs [Sun, 16 Jan 2022 01:37:03 +0000 (20:37 -0500)]
doc: adjust small words for ospfd

Signed-off-by: anlan_cs <anlan_cs@tom.com>
3 years agoMerge pull request #10343 from taspelund/fix_receivedRoutes_string
David Lamparter [Sat, 15 Jan 2022 16:23:55 +0000 (17:23 +0100)]
Merge pull request #10343 from taspelund/fix_receivedRoutes_string

3 years agotests: check if OSPF opaque attributes are installed in the RIB 9644/head
Renato Westphal [Tue, 21 Sep 2021 02:23:47 +0000 (23:23 -0300)]
tests: check if OSPF opaque attributes are installed in the RIB

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agolib, ospfd, ospf6d, zebra: add OSPF opaque route attributes
Renato Westphal [Tue, 21 Sep 2021 01:15:55 +0000 (22:15 -0300)]
lib, ospfd, ospf6d, zebra: add OSPF opaque route attributes

Update ospfd and ospf6d to send opaque route attributes to
zebra. Those attributes are stored in the RIB and can be viewed
using the "show ip[v6] route" commands (other than that, they are
completely ignored by zebra).

Example:
```
debian# show ip route 192.168.1.0/24
Routing entry for 192.168.1.0/24
  Known via "ospf", distance 110, metric 20, best
  Last update 01:57:08 ago
  * 10.0.1.2, via eth-rt2, weight 1
    OSPF path type        : External-2
    OSPF tag              : 0

debian#
debian# show ip route 192.168.1.0/24 json
{
  "192.168.1.0\/24":[
    {
      "prefix":"192.168.1.0\/24",
      "prefixLen":24,
      "protocol":"ospf",
      "vrfId":0,
      "vrfName":"default",
      "selected":true,
      [snip]
      "ospfPathType":"External-2",
      "ospfTag":"0"
    }
  ]
}
```

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
3 years agoMerge pull request #9695 from yyuanam/second_commit
David Lamparter [Sat, 15 Jan 2022 16:18:34 +0000 (17:18 +0100)]
Merge pull request #9695 from yyuanam/second_commit

3 years agoMerge pull request #10338 from opensourcerouting/pim6-no-msdp
Donald Sharp [Sat, 15 Jan 2022 16:07:44 +0000 (11:07 -0500)]
Merge pull request #10338 from opensourcerouting/pim6-no-msdp

pim6d: drop off MSDP code

3 years agoMerge pull request #10346 from donaldsharp/zebra_nht_speedup
David Lamparter [Sat, 15 Jan 2022 15:07:43 +0000 (16:07 +0100)]
Merge pull request #10346 from donaldsharp/zebra_nht_speedup

3 years agoMerge pull request #10342 from Marlinc/rfc9136
Donald Sharp [Sat, 15 Jan 2022 12:27:21 +0000 (07:27 -0500)]
Merge pull request #10342 from Marlinc/rfc9136

docs(bgp): refer to rfc9136 instead of draft

3 years agobgpd: fix advertisedRoutes json key 10343/head
Trey Aspelund [Fri, 14 Jan 2022 21:57:32 +0000 (21:57 +0000)]
bgpd: fix advertisedRoutes json key

'show bgp ... neighbor [routes|received-routes]' both incorrectly
used a json key of 'advertisedRoutes'.
This corrects the key to be 'receivedRoutes' for commands where
the displayed routes were received, not advertised.

before:
unet> r3 show ip bgp neigh 10.2.30.2 received-routes json | include Routes
  "advertisedRoutes":{

after:
ub18# show ip bgp neighbors enp1s0 received-routes json | include Routes
  "receivedRoutes":{
ub18# show ip bgp neighbors enp1s0 advertised-routes json | include Routes
  "advertisedRoutes":{

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
3 years agopim6d: drop off MSDP code 10338/head
David Lamparter [Thu, 13 Jan 2022 13:20:20 +0000 (14:20 +0100)]
pim6d: drop off MSDP code

There is no MSDP for IPv6, so drop this code out of pim6d.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #10339 from opensourcerouting/printfrr-20220114
Donald Sharp [Fri, 14 Jan 2022 19:15:03 +0000 (14:15 -0500)]
Merge pull request #10339 from opensourcerouting/printfrr-20220114

lib: printfrr shenanigans

3 years agodocs(bgp): refer to rfc9136 instead of draft 10342/head
Marlin Cremers [Fri, 14 Jan 2022 17:50:22 +0000 (18:50 +0100)]
docs(bgp): refer to rfc9136 instead of draft

Instead of referring to the draft of  IP Prefix Advertisement in
Ethernet VPN let's point to the recently published RFC9136.

Signed-off-by: Marlin Cremers <marlin@cbws.nl>
3 years agoMerge pull request #10335 from ton31337/fix/reduce_nesting_show_neighbor_bgp
Donald Sharp [Fri, 14 Jan 2022 13:11:48 +0000 (08:11 -0500)]
Merge pull request #10335 from ton31337/fix/reduce_nesting_show_neighbor_bgp

bgpd: Reduce nesting for bgp_show_peer()

3 years ago*: use semicolon after printfrr_ext_autoreg_{p,d} 10339/head
David Lamparter [Fri, 14 Jan 2022 10:56:25 +0000 (11:56 +0100)]
*: use semicolon after printfrr_ext_autoreg_{p,d}

Mostly to make clang-format not format these to peak ugly.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add `%pTH` / `%pTHD` for printing thread info
David Lamparter [Wed, 12 Jan 2022 01:07:41 +0000 (02:07 +0100)]
lib: add `%pTH` / `%pTHD` for printing thread info

Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add time formatting printfrr exts
David Lamparter [Thu, 13 Jan 2022 06:51:54 +0000 (07:51 +0100)]
lib: add time formatting printfrr exts

Refer to docs in doc/developer for details.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agolib: add `s` option to `pI4`/`pI6`/`pIA` printfrr
David Lamparter [Wed, 5 Jan 2022 15:23:23 +0000 (16:23 +0100)]
lib: add `s` option to `pI4`/`pI6`/`pIA` printfrr

Adding an `s` after these printfrr specifiers replaces 0.0.0.0 / :: in
the output with a star (`*`).  This is primarily intended for use with
multicast, e.g. to print `(*,G)`.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agotools: disable printf ext checks in checkpatch
David Lamparter [Wed, 5 Jan 2022 18:51:19 +0000 (19:51 +0100)]
tools: disable printf ext checks in checkpatch

checkpatch.pl has a hardcoded list of printf extensions supported... by
the Linux kernel.  This happens to have covered the ones we have in FRR
so far, but `%pPA` isn't on the list and others may not be either.

Since we have the frr-format GCC plugin (and CI runs that on Debian 11)
we don't really need these checks in checkpatch.pl.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agozebra: Fix for route node having no tracking NHT 10346/head
Sarita Patra [Mon, 14 Jun 2021 01:48:35 +0000 (18:48 -0700)]
zebra: Fix for route node having no tracking NHT

Topology:
IXIA-----(ens192)FRR(ens224)------iXIA

Configuration:
1. Create 8 sub-interfaces on ens192 under Default VRF and configure 8
EBGP session between FRR and IXIA.
2. Create 1000 sub-interfaces on ens224 under Default VRF and configure
1000 EBGP session between FRR and IXIA.
3. 2M prefixes distributed from Left side Ixia each with 8 ECMP path.
4. So in total, there are 2M prefixes * 8 ECMP = 16M prefixes entries
in RIB and FIB.

Issue:
Shut ens192 and ens224, this is taking 1hr 15 mins to clean up the routes.

Root Cause:
In the case of route deletion, if the particular route node is having
nht count = 0, we are going to the parent and doing nht evaluation,
which is not needed.

Fix:
If the deleted the route node is having nht count > 0, then do a nht
evaluation on the parent node.
Shut ens192 and ens224, it is taking 1 min to clean up the routes
with the fix.

Signed-off-by: Sarita Patra <saritap@vmware.com>
3 years agoMerge pull request #10337 from opensourcerouting/clippy-conds
Donald Sharp [Thu, 13 Jan 2022 18:16:13 +0000 (13:16 -0500)]
Merge pull request #10337 from opensourcerouting/clippy-conds

python: pass conditionals through clippy for DEFPY

3 years agoMerge pull request #10327 from ton31337/fix/reduce_nested_loops
Igor Ryzhov [Thu, 13 Jan 2022 17:09:50 +0000 (20:09 +0300)]
Merge pull request #10327 from ton31337/fix/reduce_nested_loops

*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting

3 years agobgpd: Reduce nesting for bgp_show_peer() 10335/head
Donatas Abraitis [Thu, 13 Jan 2022 08:15:03 +0000 (10:15 +0200)]
bgpd: Reduce nesting for bgp_show_peer()

It's hard to read sometimes or even add something more.

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #10279 from SaiGomathiN/pim_intf
David Lamparter [Thu, 13 Jan 2022 15:13:54 +0000 (16:13 +0100)]
Merge pull request #10279 from SaiGomathiN/pim_intf

3 years agopython: pass conditionals through clippy for DEFPY 10337/head
David Lamparter [Thu, 13 Jan 2022 13:18:29 +0000 (14:18 +0100)]
python: pass conditionals through clippy for DEFPY

Track what conditionals apply when a DEFPY is encountered, and stack
them around the autogenerated clippy wrapper.  Otherwise conditional
DEFPYs result in undefined function warnings.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agoMerge pull request #10336 from ton31337/feature/show_gr_llgr_timers_per_neighbor
Donald Sharp [Thu, 13 Jan 2022 14:30:16 +0000 (09:30 -0500)]
Merge pull request #10336 from ton31337/feature/show_gr_llgr_timers_per_neighbor

bgpd: Show Long-lived Graceful Restart seconds remaining per prefix

3 years agoMerge pull request #10314 from ckishimo/ospf6d_extstub
Donald Sharp [Thu, 13 Jan 2022 14:04:35 +0000 (09:04 -0500)]
Merge pull request #10314 from ckishimo/ospf6d_extstub

ospf6d: do not send Type-5 into stub area

3 years agoMerge pull request #10324 from anlancs/fix-ospf-stream
Donald Sharp [Thu, 13 Jan 2022 14:03:58 +0000 (09:03 -0500)]
Merge pull request #10324 from anlancs/fix-ospf-stream

lib: fix the right value is returned for fail cases

3 years agoMerge pull request #10334 from mobash-rasool/igmp-conf-fix
Donald Sharp [Thu, 13 Jan 2022 14:00:51 +0000 (09:00 -0500)]
Merge pull request #10334 from mobash-rasool/igmp-conf-fix

pimd: IGMP messages may be longer than 8 octets

3 years ago*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting 10327/head
Donatas Abraitis [Wed, 12 Jan 2022 20:43:52 +0000 (22:43 +0200)]
*: Add FOREACH_AFI_SAFI_NSF(afi, safi) macro to reduce nesting

Used for graceful-restart mostly.

Especially for bgp_show_neighbor_graceful_restart_capability_per_afi_safi()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agopim: Northbound changes accomodating IPV4 address family 10179/head
sarita patra [Wed, 15 Dec 2021 13:24:51 +0000 (05:24 -0800)]
pim: Northbound changes accomodating IPV4 address family

frr-pim.yang, created a list of address family under pim
container. For PIMV4 the key is IPV4, where as for PIMV6
the key is IPV6. This is done for PIMV6 development.

This commit will have all the northbound changes to support
IPV4 address family.

Signed-off-by: sarita patra <saritap@vmware.com>
3 years agobgpd: Show Long-lived Graceful Restart timer remaining per prefix 10336/head
Donatas Abraitis [Thu, 13 Jan 2022 08:39:15 +0000 (10:39 +0200)]
bgpd: Show Long-lived Graceful Restart timer remaining per prefix

```
exit1-debian-11# sh ip bgp 100.100.100.100/32
BGP routing table entry for 100.100.100.100/32, version 7
Paths: (2 available, best #2, table default)
  Advertised to non peer-group peers:
  home-spine1.donatas.net(192.168.0.2)
  65002, (stale)
    192.168.10.17 from donatas-pc(192.168.10.17) (0.0.0.0)
      Origin incomplete, valid, external
      Community: llgr-stale
      Last update: Thu Jan 13 08:58:08 2022
      Time until Long-lived stale route deleted: 18
  65001
    192.168.0.2 from home-spine1.donatas.net(192.168.0.2) (2.2.2.2)
      Origin incomplete, metric 0, valid, external, best (First path received)
      Last update: Thu Jan 13 08:57:56 2022
```

```
~# vtysh -c 'show ip bgp 100.100.100.100/32 json' | jq '."paths"[] | ."llgrSecondsRemaining"'
17
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Avoid additional check for json output under show ip bgp route
Donatas Abraitis [Thu, 13 Jan 2022 08:34:04 +0000 (10:34 +0200)]
bgpd: Avoid additional check for json output under show ip bgp route

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agopimd: IGMPv2 leave msg may be longer than 8 octets 10334/head
Mobashshera Rasool [Thu, 13 Jan 2022 08:07:12 +0000 (00:07 -0800)]
pimd: IGMPv2 leave msg may be longer than 8 octets

Fix the code as per RFC 2236 section 2.5:
   Note that IGMP messages may be longer than 8 octets, especially
   future backwards-compatible versions of IGMP.  As long as the Type is
   one that is recognized, an IGMPv2 implementation MUST ignore anything
   past the first 8 octets while processing the packet.  However, the
   IGMP checksum is always computed over the whole IP payload, not just
   over the first 8 octets.

Fixes: #10331
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agopimd: IGMPv2 report msg may be longer than 8 octets
Mobashshera Rasool [Thu, 13 Jan 2022 04:39:48 +0000 (20:39 -0800)]
pimd: IGMPv2 report msg may be longer than 8 octets

As per test case IGMP Conformance test case 5.6, report
messages longer than 8 octets should be accepted to support
future-backward compatibilty.

Fix the code as per RFC 2236 section 2.5:
    Note that IGMP messages may be longer than 8 octets, especially
    future backwards-compatible versions of IGMP.  As long as the Type is
    one that is recognized, an IGMPv2 implementation MUST ignore anything
    past the first 8 octets while processing the packet.  However, the
    IGMP checksum is always computed over the whole IP payload, not just
    over the first 8 octets.

Fixes: #10331
Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
3 years agoMerge pull request #10328 from ton31337/fix/vty_json
Igor Ryzhov [Thu, 13 Jan 2022 06:45:57 +0000 (09:45 +0300)]
Merge pull request #10328 from ton31337/fix/vty_json

3 years agoMerge pull request #10266 from opensourcerouting/bgp-aggr-rm
Donatas Abraitis [Wed, 12 Jan 2022 21:18:58 +0000 (23:18 +0200)]
Merge pull request #10266 from opensourcerouting/bgp-aggr-rm

bgpd: fix aggregate route unsuppression bug

3 years agoospfd: Use vty_json() for show_ip_ospf_gr_helper_cmd 10328/head
Donatas Abraitis [Wed, 12 Jan 2022 20:51:46 +0000 (22:51 +0200)]
ospfd: Use vty_json() for show_ip_ospf_gr_helper_cmd

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agobgpd: Use vty_json() for bgp_print_dampening_parameters()
Donatas Abraitis [Wed, 12 Jan 2022 20:50:26 +0000 (22:50 +0200)]
bgpd: Use vty_json() for bgp_print_dampening_parameters()

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
3 years agoMerge pull request #10282 from opensourcerouting/pim6-addr-replace
Donald Sharp [Wed, 12 Jan 2022 20:34:46 +0000 (15:34 -0500)]
Merge pull request #10282 from opensourcerouting/pim6-addr-replace

pimd: `prefix_sg` => `pim_sgaddr`

3 years agoMerge pull request #10325 from donaldsharp/peer_conditional_adv_cleanup
Donatas Abraitis [Wed, 12 Jan 2022 20:15:49 +0000 (22:15 +0200)]
Merge pull request #10325 from donaldsharp/peer_conditional_adv_cleanup

bgpd: Remove unneeded loop over all peers

3 years agopimd: `prefix_sg` => `pim_sgaddr` 10282/head
David Lamparter [Tue, 4 Jan 2022 16:54:44 +0000 (17:54 +0100)]
pimd: `prefix_sg` => `pim_sgaddr`

Mostly just 2 sed calls:

- `sed -e 's%struct prefix_sg%pim_sgaddr%g'`
- `sed -e 's%memset(&sg, 0, sizeof(pim_sgaddr));%memset(\&sg, 0, sizeof(sg));%g'`

Plus a bunch of fixing whatever that broke.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
3 years agopimd: temporarily disable IPv6 types
David Lamparter [Mon, 10 Jan 2022 08:40:50 +0000 (09:40 +0100)]
pimd: temporarily disable IPv6 types

Just putting the infrastructure in place and having it disabled is
actually good progress here;  have the compiler make itself useful and
tell us what we have to do to get the basics right.

(The next commit will cause a *lot* of compile errors as soon as
`PIM_V6_TEMP_BREAK` is set; but there is no reason to force everything
into a single step here.)

To enable `pim_addr = in6_addr`, run `make PIM_V6_TEMP_BREAK=1` (remove
previous compile results with `rm pimd/pim6d-*.o`)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>