Commit Graph

28104 Commits

Author SHA1 Message Date
Donatas Abraitis
e8e36ff315 bgpd: Convert bpacket_attr_vec_type to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:13:55 +03:00
Donatas Abraitis
79288e4c12 bgpd: Convert bgp_attr_parse_ret_t to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:13:55 +03:00
Donatas Abraitis
9c2fd3fe44 bgpd: Convert vpn_policy_direction_t to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:13:55 +03:00
Donatas Abraitis
d54f55f22d bgpd: Convert bgp_policy_type_e to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:13:55 +03:00
Donatas Abraitis
3061acc235 bgpd: Convert bgp_peer_sort_t to enum
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:13:55 +03:00
Donatas Abraitis
26870e2dcc bgpd: Fix styling, drop braces for single statement block
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:12:16 +03:00
Donatas Abraitis
58cf5c088a bgpd: Reuse bgp_attr_set_ecommunity() for setting attribute flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:09:28 +03:00
Donatas Abraitis
9d34440bf8 bgpd: Reuse bgp_attr_set_[l]community() for setting attribute flags
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-12 22:09:28 +03:00
Russ White
695c24c3b0
Merge pull request #10994 from opensourcerouting/fix/autocomplete_for_advertise_map
bgpd: Use autocomplete for route-map under conditional advertisements CLI
2022-04-12 14:40:33 -04:00
Russ White
94ee557658
Merge pull request #10999 from opensourcerouting/fix/bgp_aliases_with_community
bgpd: Allow setting BGP [large]community in route-maps
2022-04-12 14:37:58 -04:00
Mark Stapp
946fb036a3
Merge pull request #11000 from opensourcerouting/feature/show_conditional_adv_timer_in_neighbor_cli
bgpd: Show conditional advertisement timers in neighbor CLI output
2022-04-12 11:54:16 -04:00
mobash-rasool
8e53f35b5f
Merge pull request #10989 from opensourcerouting/pim-options-remove
pimd: remove pim_interface->options
2022-04-12 21:10:44 +05:30
anlan_cs
fff7545a03 bgpd: correct a few comments for evpn-mh
Correct a few evpn-mh omissions mainly on type-1 and type-4.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-04-12 09:33:06 -04:00
Balaji Gurudoss
a8caf78d61 pim6d: Addition of ipv6 ssmpingd config commands
Signed-off-by: Balaji Gurudoss <G_Balaji1@dell.com>
2022-04-12 18:07:24 +05:30
Donatas Abraitis
af3b36a1e1
Merge pull request #11003 from anlancs/bgpd-mh-trival-remove
bgpd: correct one flag name on comment for evpn-mh
2022-04-12 09:00:08 +03:00
anlan_cs
9a8fc8f88d zebra: simplify one check for evpn-mh
An simplification for one check in
`zebra_evpn_mh_uplink_oper_flags_update()`.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-04-12 01:26:54 -04:00
kuldeepkash
40c28c860a tests: Add multicast_pim_dr_nondr_test suite
1. Added test cases to test/verify multicast_pim_dr_nondr scenarios

Signed-off-by: kuldeepkash <kashyapk@vmware.com>
2022-04-12 02:39:39 +05:30
Igor Ryzhov
5c73173536
Merge pull request #11006 from opensourcerouting/fix/remove_&routemap_optimization_cmd
lib: Remove deprecated routemap_optimization_cmd
2022-04-11 23:22:41 +03:00
Donatas Abraitis
764402feba bgpd: Fix styling for aggregate_addressv4_cmd
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-11 17:53:42 +03:00
Donatas Abraitis
cacba915d0 bgpd: Add autocomplete for aggregate-address ... route-map X
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-11 17:47:52 +03:00
Donatas Abraitis
59136db5a7 bgpd: Send MED attribute when aggregate prefix is created
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-11 17:46:04 +03:00
Donatas Abraitis
5e1a1129f5
Merge pull request #11007 from mobash-rasool/fixes
pimd: correct the show ip igmp sources output
2022-04-11 14:28:15 +03:00
Mobashshera Rasool
e1f87dce0f pimd: correct the show ip igmp sources output
frr(config-if)# ip igmp join 232.1.1.1 10.10.10.10
frr(config-if)# do sh ip igmp sources
Interface        Address         Group           Source          Timer Fwd Uptime
ens192           232.1.1.1       10.10.10.10     04:10   N 00:00:10
frr(config-if)#

The above output is misaligned and is having Address field which is not
required here.

Fixing it.

Signed-off-by: Mobashshera Rasool <mrasool@vmware.com>
2022-04-11 00:17:11 -07:00
Donatas Abraitis
c90fab3c26 lib: Remove deprecated routemap_optimization_cmd
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-11 10:12:18 +03:00
Donald Sharp
747aa92e74 tests: Do not turn off multicast stream
The test is testing whether interface flaps are causing
the appropriate pim reactions.  Unfortunately the test
is turning off the multicast stream and the test also
has a keep alive timer of 15 seconds set on all routers.
Which of course means the test has 15 seconds(at most) to finish
testing.  This is not always possible given system loads.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-10 07:47:38 -04:00
Donald Sharp
184ab61ee3 tests: Fix test_multicast_pim_sm_topo3.py from generating a support bundle
The test_multicast_pim_sm_topo3.py test is both spending extra time
looking for state that will never occurr but also generating a support
bundle when it doesn't find it.  Fix the test to come to the correct
solution faster.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-10 07:47:18 -04:00
anlan_cs
b3ba21181a bgpd: correct one flag name on comment for evpn-mh
Correct flag name of `attr.es_flags` - ATTR_ES_L3_NHG_USE.

"bgp_path_info"s (Per "es-vrf") with this flag can use l3nhg.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-04-10 19:39:19 +08:00
Donald Sharp
efcd39d87b tests: Add a test case for a kernel route depending on a kernel route
Add a test case where a kernel route depends on a kernel route
and when you perturb an interface, ensure that FRR does not
loose the route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-09 15:52:58 -04:00
Donald Sharp
c9e4abf81f zebra: Allow system routes to recurse through themselves
Currently if a end user has something like this:

Routing entry for 192.168.212.1/32
  Known via "kernel", distance 0, metric 100, best
  Last update 00:07:50 ago
  * directly connected, ens5

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, 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.212.1, ens5, src 192.168.212.19, 00:00:15
C>* 192.168.212.0/27 is directly connected, ens5, 00:07:50
K>* 192.168.212.1/32 [0/100] is directly connected, ens5, 00:07:50

And FRR does a link flap, it refigures the route and rejects the default
route:

2022/04/09 16:38:20 ZEBRA: [NZNZ4-7P54Y] default(0:254):0.0.0.0/0: Processing rn 0x56224dbb5b00
2022/04/09 16:38:20 ZEBRA: [ZJVZ4-XEGPF] default(0:254):0.0.0.0/0: Examine re 0x56224dbddc20 (kernel) status: Changed Installed flags: Selected dist 0 metric 100
2022/04/09 16:38:20 ZEBRA: [GG8QH-195KE] nexthop_active_update: re 0x56224dbddc20 nhe 0x56224dbdd950 (7), curr_nhe 0x56224dedb550
2022/04/09 16:38:20 ZEBRA: [T9JWA-N8HM5] nexthop_active_check: re 0x56224dbddc20, nexthop 192.168.212.1, via ens5
2022/04/09 16:38:20 ZEBRA: [M7EN1-55BTH]         nexthop_active: Route Type kernel has not turned on recursion
2022/04/09 16:38:20 ZEBRA: [HJ48M-MB610]         nexthop_active_check: Unable to find active nexthop
2022/04/09 16:38:20 ZEBRA: [JPJF4-TGCY5] default(0:254):0.0.0.0/0: After processing: old_selected 0x56224dbddc20 new_selected 0x0 old_fib 0x56224dbddc20 new_fib 0x0

So the 192.168.212.1 route is matched for the nexthop but it is not connected and
zebra treats it as a problem.  Modify the code such that if a system route
matches through another system route, then it should work imo.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-09 13:17:14 -04:00
Donatas Abraitis
6e37924b05 bgpd: Show conditional advertisement timers in neighbor CLI output
```
spine1-debian-11# sh ip bgp neighbors 192.168.0.1
BGP neighbor is 192.168.0.1, remote AS 65001, local AS 65000, external link
Hostname: exit1-debian-11
  BGP version 4, remote router ID 192.168.10.123, local router ID 192.168.100.1
  BGP state = Established, up for 00:00:32
  Last read 00:00:30, Last write 00:00:30
  Hold time is 180, keepalive interval is 60 seconds
  Configured conditional advertisements interval is 5 seconds
  Time until conditional advertisements begin is 4 seconds
```

```
    "bgpTimerConfiguredConditionalAdvertisementsSec":5,
    "bgpTimerUntilConditionalAdvertisementsSec":1,
```

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-09 18:12:36 +03:00
Russ White
d6d890a656
Merge pull request #10919 from donaldsharp/lost_kernel_routes
zebra: Allow multiple connected routes to be choosen for kernel routes
2022-04-09 11:09:40 -04:00
Donatas Abraitis
c0945b7828 bgpd: Allow setting BGP [large]community in route-maps
Before:
```
spine1-debian-11(config-route-map)# bgp community alias 65001:65001 test1
spine1-debian-11(config)# route-map rm permit 10
spine1-debian-11(config-route-map)# set community 65001:65001
% Malformed communities attribute
```

After:
```
spine1-debian-11(config)# bgp community alias 65001:65001 test1
spine1-debian-11(config)# route-map rm permit 10
spine1-debian-11(config-route-map)# set community 65001:65001
spine1-debian-11(config-route-map)#
```

Same for large-communities.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-09 17:34:06 +03:00
Donald Sharp
6d0fa5c228 watchfrr: Send operational state to systemd
When watchfrr has noticed issues, send operational state
to systemd so operators issuing `systemd status frr` can
see a more nuanced state of the daemon.

Add the `--operational-timeout X` value to the cli. After
the daemon has been restarted and communication re-established
wait this time before reporting to systemd that the daemon
is up and running.

Default value of 60 seconds was choosen to allow some small
delay in reporting so that, if the daemon is in a crash loop
status will not ping pong.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08 15:56:17 -04:00
Donatas Abraitis
9118301e48 bgpd: Do not forget to update conditional advertisements rmaps for peer-groups
When the peer is configured for the first time:
```
neighbor P1 peer-group
neighbor P1 remote-as external
neighbor P1 advertise-map ADV exist-map EXIST
neighbor 10.10.10.1 peer-group P1
```

Conditional advertisements route-maps are not updated and cond. advertisements
do not work until FRR restarted. BGP sessions clear does not help.

Or even changing peer-group for a peer, causes this bug to kick in.

```
no neighbor 10.10.10.1
neighbor 10.10.10.1 peer-group P2
```

With this fix, cond. advertisements start working immediatelly.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-08 22:43:01 +03:00
mobash-rasool
ef362a5156
Merge pull request #10981 from opensourcerouting/vty-wrmem-newline
vtysh: remove extraneous newline
2022-04-08 22:09:16 +05:30
Donatas Abraitis
3ccddc2566 bgpd: Use autocomplete for route-map under conditional advertisements CLI
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-04-08 16:54:22 +03:00
Donald Sharp
050d644400 doc: Add show ip nht.. documentation
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08 08:18:39 -04:00
Donald Sharp
91a5a6e75c tests: Add a test to ensure that FRR does not loose kernel routes
Add a test case to ensure that Kernel routes are not lost
when there are multiple overlapping connected routes.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08 08:15:20 -04:00
Donald Sharp
48dc861028 zebra: Allow multiple connected routes to be choosen for kernel routes
This bug should only really affect kernel routes.  To reproduce:

a) Have multiple connected routes that point to the same prefix
swp8  up      default         169.254.0.250/30
swp9  up      default         169.254.0.250/30

b) Have a kernel route that uses one of those connected routes
7.6.2.8 via 169.254.0.249 dev swp8 proto static
(But have it choose a non-selected connected nexthop)

c) Introduce an event that causes the rib table to be reprocessed,
say a unrelated interface going up / down

  This causes the route to be lost with this message:
2022/03/28 21:21:53 ZEBRA: [YXCJP-0WZWV] netlink_nexthop_msg_encode: ID (3454): 169.254.0.249, via swp8(1383) vrf default(0)
2022/03/28 21:21:53 ZEBRA: [YF2E6-J60JH] nexthop_active: 169.254.0.249, via swp8 given ifindex does not match nexthops ifindex found found: directly connected, swp9

Effectively the nexthop that zebra is choosing would not be the one
that the kernel route has choosen and FRR removes the route:
022/03/28 21:21:53 ZEBRA: [NM15X-X83N9] rib_process: (0:254):7.6.2.8/32: rn 0x56042e632e90, removing re 0x56042e6316e0
2022/03/28 21:21:53 ZEBRA: [Y53JX-CBC5H] rib_unlink: (0:254):7.6.2.8/32: rn 0x56042e632e90, re 0x56042e6316e0
2022/03/28 21:21:53 ZEBRA: [KT8QQ-45WQ0] rib_gc_dest: (0:?):7.6.2.8/32: removing dest from table

What is happening?

Zebra is not looking at all connected routes and if any of them
would have the appropriate ifindex and just blindly rejecting
the route.

So when nexthop resolution happens and it matches a connected
route and the dest->selected nexthop ifindex does not match, let's sort
through the rest of them and see if any of them match and if so
let's keep the route.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-08 08:15:20 -04:00
Donatas Abraitis
b4bdcf45d5
Merge pull request #10982 from donaldsharp/enum_watchfrr
Enum watchfrr
2022-04-08 14:58:36 +03:00
David Lamparter
4f977c8e77 pimd: remove pim_interface->options
I should've removed this in #10960.  It's a hazard in terms of
forgetting to adjust PRs/other changes that might accidentally still
reference the field.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-08 10:30:24 +02:00
Philippe Guibert
ae59cfd796 isisd: add bfd information on isis neighbor show command
Add bfd information on show isis neighbor command.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2022-04-08 09:06:01 +02:00
Donald Sharp
e09284ca09
Merge pull request #10979 from opensourcerouting/pim-ssm-clean
lib, pimd: small cleanup in multicast addr helpers (SSM & co.)
2022-04-07 13:08:01 -04:00
David Lamparter
edae23ff58 vtysh: remove extraneous newline
vtysh_client_execute() expects just a string without a newline; the
newline is passed through and ends up in logging output where newlines
are not quite wanted.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 17:55:35 +02:00
Donald Sharp
c3db4ca8ed watchfrr: Convert daemon_state_t to an enum instead of a typedef
Align watchfrr with our coding standard

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-07 08:57:42 -04:00
Donald Sharp
f1692c510b watchfrr: Rename restart_phase_t to enum restart_phase
This will align with our coding standards.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2022-04-07 08:57:42 -04:00
David Lamparter
95793341ab pimd: use SSM check helper
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 14:00:40 +02:00
David Lamparter
eeec411244 lib, pimd: add a bunch of address helpers
Just simple helpers to get a scope value, never-forward, and is-SSM for
a given address.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2022-04-07 14:00:36 +02:00
anlan_cs
bce8bf5844 bgpd: cosmetic change for evpn-mh
Two cosmetic change -
1) Remove unnecessary local variable - `es_vtep` used in one condition.
2) Remove unused variable - `es_cnt`. `proc_cnt` has already taken `es`
   into account.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-04-07 06:10:36 -04:00
Igor Ryzhov
5451fbc192
Merge pull request #10927 from bobuhiro11/refactor_srv6_locator_chunks
bgpd: refactor type of srv6_locator_chunks list
2022-04-06 21:36:39 +03:00