Commit Graph

29152 Commits

Author SHA1 Message Date
Quentin Young
7590fd4965
Merge pull request #10410 from idryzhov/pim-memleaks 2022-01-25 11:41:09 -05:00
Russ White
e48b2fea63
Merge pull request #10411 from idryzhov/if-config-vrf-name
*: do not print vrf name for interface config when using vrf-lite
2022-01-25 11:34:59 -05:00
David Lamparter
414db8e341
Merge pull request #10395 from qlyoung/fix-pim-xpath-buffer-sizes 2022-01-25 17:22:39 +01:00
Sai Gomathi
4527b70aed pimd: json support added for command "show ip igmp sources"
Add JSON support in the show command
“show ip igmp sources” with proper formatting.

Signed-off-by: Sai Gomathi <nsaigomathi@vmware.com>
2022-01-25 06:29:37 -08:00
Igor Ryzhov
f55450f5a2
Merge pull request #10419 from qlyoung/fix-logrotate-staticd-typo
redhat: logrotate file has typo for staticd
2022-01-25 16:58:12 +03:00
anlan_cs
ebf8b885de bfdd,yang: optimize nb with YANG
A few optimizations for bfd NB:
    - Remove unuseful checks for parameters with the same values
    - Replace checking values of bfd parameters with YANG's "range"
    - Append "required-echo-receive-interval" with 0 for it can be disabled

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-25 04:00:49 -05:00
Trey Aspelund
d20e1bba27 tests: add topotest for remove-private-AS
Introduces a topotest to validate proper AS-Path manipulation when using
"neighbor ... remove-private-AS".

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-01-24 20:06:50 +00:00
Trey Aspelund
179d5a0e26 bgpd: retain peer asn even with remove-private-AS
In situations where remove-private-AS is configured for eBGP peers
residing in a private ASN, the peer's ASN was not being retained
in the AS-Path which can allow loops to occur. This was addressed
in a prior commit but it only addressed cases where the "replace-AS"
keyword was configured.
This commit ensures we retain the peer's ASN when using
"remove-private-AS" for eBGP peers in a private ASN regardless of other
keywords.

Setup:
=========
router bgp 4200000002
 neighbor enp1s0 interface v6only remote-as external
 neighbor enp6s0 interface v6only remote-as external
 !
 address-family ipv4 unicast
  neighbor enp6s0 remove-private-AS
 exit-address-family

ub18# show ip bgp sum | include 420000
BGP router identifier 100.64.0.111, local AS number 4200000002 vrf-id 0    <<<<< local asn 4200000002
ub20(enp1s0)    4 4200000001        22        22        0    0    0 00:00:57            1        1
ub20(enp6s0)    4 4200000001        21        22        0    0    0 00:00:57            0        1   <<<< peer asn 4200000001

ub18# show ip bgp | include 0.2
Default local pref 100, local AS 4200000002
*> 100.64.0.2/32    enp1s0                   0             0 4200000001 4200000004 4200000005 4200000001 i

Before ("remote-private-AS" only):
=========
ub18# show ip bgp neighbors enp6s0 advertised-routes | include 100.64.0.2
*> 100.64.0.2/32    ::                                     0 i     <<<<<  empty as-path, no way to prevent loop

After ("remote-private-AS" only):
=========
ub18# show ip bgp neighbors enp6s0 advertised-routes | include 100.64.0.2
*> 100.64.0.2/32    ::                                     0 4200000001 4200000001 i    <<<< retain peer's asn, breaks loop

Ticket: 2857047
Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2022-01-24 20:06:50 +00:00
Quentin Young
3485554031 redhat: logrotate file has typo for staticd
s/static/staticd

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-01-24 15:05:48 -05:00
Igor Ryzhov
870791a3b5 *: do not send opaque data to zebra by default
Opaque data takes up a lot of memory when there are a lot of routes on
the box. Given that this is just a cosmetic info, I propose to disable
it by default to not shock people who start using FRR for the first time
or upgrades from an old version.

Fixes #10101.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 22:18:46 +03:00
Igor Ryzhov
3c10fb92c1 pimd: fix interface info memory leak
When the interface is deleted from the system, its info must be freed.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 20:14:18 +03:00
Igor Ryzhov
6b88faa7ff pimd: move iface lib initialization to a proper place
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 20:14:18 +03:00
Quentin Young
d7073b211a pimd: fix misuse of xpath buf size constants
XPATH_MAXLEN denotes the maximum length of an XPATH. It does not make
sense to allocate a buffer intended to contain an XPATH with a size
larger than the maximum allowable size of an XPATH. Consequently this PR
removes buffers that do this. Prints into these buffers are now checked
for overflow.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2022-01-24 11:13:28 -05:00
Russ White
5b05ce9ff5
Merge pull request #10374 from opensourcerouting/bgp-reset-counters
bgpd: Reset message statistics with clear command
2022-01-24 07:52:11 -05:00
Russ White
6ab0d40e87
Merge pull request #10380 from ton31337/feature/show_graceful_restart_timer_per_prefix
bgpd: Show Graceful Restart seconds remaining per prefix
2022-01-24 07:51:19 -05:00
Russ White
1f2c4ddecb
Merge pull request #10381 from idryzhov/drop-gw-addr
BGP EVPN overlay index fixes and improvements
2022-01-24 07:50:20 -05:00
Russ White
bbc9f23e0c
Merge pull request #10402 from ton31337/fix/capability_extended-nexthop_cli_hidden
bgpd: Show negative form of capability extended-nexthop for interface…
2022-01-24 07:35:21 -05:00
Russ White
c2a0f12f78
Merge pull request #10407 from idryzhov/ospf-opaque-crash
ospfd: fix crash on "ospf send-extra-data zebra"
2022-01-24 07:34:30 -05:00
Russ White
bbf1101240
Merge pull request #10412 from idryzhov/zebra-vrf-delete
zebra: fix vrf deletion
2022-01-24 07:33:53 -05:00
Igor Ryzhov
788a036fdb *: do not print vrf name for interface config when using vrf-lite
VRF name should not be printed in the config since 574445ec. The update
was done for NB config output but I missed it for regular vty output.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 14:44:05 +03:00
anlan_cs
580b190c92 doc: clarify bfd parameters' overriden method
Here "new" is very puzzling. If new parameters with default values on peer
configuration node are set, they will not be used yet.

So just clarify it:
Only "non-default" values on peer configuration node are set, they can override
the conrresponding values from profile.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-24 03:03:17 -05:00
anlan_cs
0c91b419fd yang: fix "minimum-ttl" missing default value
Just like other parameters of bfd, "minimum-ttl" should also have
a default value. Parameters with default value will not be displayed
in running configuration.

Additionly adjust the other "range" with double quotation marks.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-24 02:54:02 -05:00
Donatas Abraitis
6b968475ed
Merge pull request #10406 from idryzhov/zebra-opaque-memleak
zebra: fix opaque data memleak
2022-01-24 09:38:54 +02:00
Russ White
2d9e10d095
Merge pull request #10318 from donaldsharp/redistribution
OSPF Redistribution
2022-01-23 22:30:24 -05:00
Russ White
459f64c591
Merge pull request #10352 from ton31337/fix/autocomplete_neighbor_peergroup
bgpd: Add peer-groups to neighbor autocomplete
2022-01-23 22:29:44 -05:00
Russ White
6bc879bb33
Merge pull request #10348 from ton31337/fix/gr_dynamic_neighbors2
bgpd: Graceful-restart / LLGR with dynamic peers
2022-01-23 22:28:34 -05:00
anlan_cs
09e949a64f bfdd: correct one word of comment
Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-23 20:25:25 -05:00
Igor Ryzhov
e4c5b3ba06 zebra: fix vrf deletion
VRF deletion code must be called after the corresponding interface
deletion code.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-24 01:51:10 +03:00
Igor Ryzhov
6ae27a4be5 ospfd: fix crash on "ospf send-extra-data zebra"
`ospf->new_table` is NULL if the OSPF instance has no routes.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-23 16:10:55 +03:00
Igor Ryzhov
dc00940b66 zebra: fix opaque data memleak
Opaque data should be freed together with route entry in case of errors.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-23 15:39:04 +03:00
rgirada
1478f0ad11 ospfd: topotest cases for LSID change algo
Description:
	Topotest cases for LSID change (RFC 2328 appendex-E)
	algorithm.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-01-22 04:10:20 -08:00
rgirada
a8c22275fe ospfd: Modifying LSID generation algorithm
Description:
	This LSID alogithm added as per rcf2328 Appendex-E recommendation.
	This applies only for AS-external lsas and summary lsas.

	As an example of the algorithm, consider its operation when the
        following sequence of events occurs in a single router (Router A).

        (1) Router A wants to originate an AS-external-LSA for
            [10.0.0.0,255.255.255.0]:

            (a) A Link State ID of 10.0.0.0 is used.

        (2) Router A then wants to originate an AS-external-LSA for
            [10.0.0.0,255.255.0.0]:

            (a) The LSA for [10.0.0,0,255.255.255.0] is reoriginated using a
                new Link State ID of 10.0.0.255.

            (b) A Link State ID of 10.0.0.0 is used for
                [10.0.0.0,255.255.0.0].

        (3) Router A then wants to originate an AS-external-LSA for
            [10.0.0.0,255.0.0.0]:
            (a) The LSA for [10.0.0.0,255.255.0.0] is reoriginated using a
                new Link State ID of 10.0.255.255.

            (b) A Link State ID of 10.0.0.0 is used for
                [10.0.0.0,255.0.0.0].

            (c) The network [10.0.0.0,255.255.255.0] keeps its Link State ID
                of 10.0.0.255.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2022-01-22 04:07:59 -08:00
anlan_cs
19a99d89f0 tools: suppress unuseful warnings during restarting frr
Problem:
During restarting frr.service, it throws annoying warnings:
Cannot stop bgpd(and others): pid file not found.

Root Cause:
During restarting process, systemd uses "stop", and watchfrr
uses "restart".
Yes, watchfrr using "restart" is to avoid systemd failing to stop.
But it should be quiet.

Fix:
During restarting service, suppress these warnings from watchfrr.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2022-01-21 21:23:22 -05:00
Donatas Abraitis
843770f609 bgpd: Show negative form of capability extended-nexthop for interface peers
```
exit1-debian-11(config-router)# neighbor 192.168.100.3 remote-as external
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
 neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# no neighbor 192.168.100.3 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor eth0 interface remote-as external
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
exit1-debian-11(config-router)# no neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)# do sh run | include extended
 no neighbor eth0 capability extended-nexthop
exit1-debian-11(config-router)#
```

Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2022-01-21 23:36:37 +02:00
Quentin Young
9e84443aca
Merge pull request #10398 from patrasar/pim_debug_fix 2022-01-21 14:08:48 -05:00
Jafar Al-Gharaibeh
cdaa204eff
Merge pull request #8011 from donaldsharp/starvation
lib: Figure out if we are being starved for cpu
2022-01-21 09:01:42 -06:00
sarita patra
5c4508cb32 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>
2022-01-21 03:05:18 -08:00
Igor Ryzhov
c63f4b0ffd
Merge pull request #10392 from pguibert6WIND/isis_vrf_change 2022-01-20 20:47:33 +03:00
Louis Scalbert
f5b25d2c34 topotests: apply bgp maximum-prefix-out without clearing the neighbor
The current maximum-prefix-out topo-test starts a configuration with a
maximum-prefix-out.

Test the application of new maximum-prefix-out value without clearing
the neighbor.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-20 18:19:37 +01:00
Louis Scalbert
d0bf49ecd5 bgpd: apply maximum-prefix-out without clearing the neighbor
Abstract:
- The command "neighbor PEER maximum-prefix-out NUMBER" cannot be applied
  without clearing the BGP neighbor.
- Apply the maximum-prefix-out value as soon as it is modified without
  clearing the neighbor.

subgroup_update_packet() and subgroup_withdraw_packet() respectively
manages the announcement and withdrawal BGP message to the peer.
subgrp->scount counter counts the number of sent prefixes.

Before the patch, the maximum out prefix limitation was applied in
subgroup_update_packet() in order that subgrp->scount never exceeds the
limit. Setting a limit inferior to the effective number of sent prefix
did not result in sending any withdrawal message to reduce the number of
sent prefixes. Without clearing the BGP neighbor, the limitation only
applied to the announcement of new prefixes when the limitation was
over.

With the patch, the limitation is checked in subgroup_announce_check().
The function is intended to say whether a prefix has to be announced in
regards to the prefix-list, route-map... Now when a maximum-prefix-out
value is changed/removed, the neighbor AFI/SAFI table is re-parsed in
the same way as for the application of route-map, prefix-lists...

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-20 18:19:37 +01:00
Louis Scalbert
e02672605b bgpd: fix calculation of update-group hash with maximum-prefix-out
Take into account the maximum-prefix-out value when calculating the
update-group hash.

Fixes: fde246e835 ("bgpd: Add an option to limit outgoing prefixes")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2022-01-20 18:19:37 +01:00
Donald Sharp
e8b3a2f74b 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>
2022-01-20 11:58:48 -05:00
Donald Sharp
ab01a00176 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>
2022-01-20 11:56:27 -05:00
Abhishek N R
d6f31d2ab3 pimd : Handling of IGMPv2 report message for SSM aware group range.
Problem Statement:
==================

(rcv1)-----A----B---C
 v3 enabled with src 90.0.0.1
       |
(rcv2)--
 v2 enable with src none

rcv1 sends the packet in INCLUDE mode, rcv2 sends the IGMPv2 report
and PIM convers this report into exclude mode.
As per the state machine the group structure was
getting added and deleted. As group gets deleted the mroute for 90.0.0.1
and recreated back.
This effects the end to end trafiic.

Root Cause Analysis:
====================
As per state machine
INCLUDE (A) IS_EX (B) EXCLUDE (A*B,B-A) (B-A)=0
Delete (A-B)
Group Timer=GMI

EXCLUDE (X,Y) TO_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=Group Timer
Delete (X-A)
Delete (Y-A)
Send Q(G,A-Y)
Group Timer=GMI

The above equations were getiing calulated for IP address
90.0.0.1 and 0.0.0.0
This results in group creation deletion.

Fix:
====
As per RFC 4604.
drop the exclude mode, IGMP reports, if destnation group is
SSM based.
EXCLUDE
mode does not apply to SSM addresses, and an SSM-aware router will
ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in the SSM
range,

Signed-off-by: Abhishek N R <abnr@vmware.com>
Signed-off-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
2022-01-20 07:52:17 -08:00
Abhishek N R
f6053ff29d pimd : Handling of Exclude mode IGMPv3 report messages for SSM aware group.
Problem Statement:
==================

(rcv1)-----A----B---C
 v3 enabled with src 90.0.0.1
       |
(rcv2)--
 v3 enable with src none

rcv1 sends the packet in INCLUDE mode, rcv2 sends the IGMP report
in exclude mode. As per the state machine the group structure was
getting added and deleted. As group gets deleted the mroute for 90.0.0.1
and recreated back.
This effects the end to end trafiic.

Root Cause Analysis:
====================
As per state machine
INCLUDE (A) IS_EX (B) EXCLUDE (A*B,B-A) (B-A)=0
Delete (A-B)
Group Timer=GMI

EXCLUDE (X,Y) TO_EX (A) EXCLUDE (A-Y,Y*A) (A-X-Y)=Group Timer
Delete (X-A)
Delete (Y-A)
Send Q(G,A-Y)
Group Timer=GMI

The above equations were getiing calulated for IP address
90.0.0.1 and 0.0.0.0
This results in group creation deletion.

Fix:
====
As per RFC 4604.
drop the exclude mode, IGMP reports, if destnation group is
SSM based.
EXCLUDE
mode does not apply to SSM addresses, and an SSM-aware router will
ignore MODE_IS_EXCLUDE and CHANGE_TO_EXCLUDE_MODE requests in the SSM
range.

Signed-off-by: Abhishek N R <abnr@vmware.com>
Signed-off-by: Vishal Dhingra <rac.vishaldhingra@gmail.com>
2022-01-20 07:52:06 -08:00
Philippe Guibert
6f48266e1d 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>
2022-01-20 16:19:14 +01:00
Martin Buck
b74e965142 ospf6d: Fix ECMP inter-area route nexthop update
Fixes #9720. When updating an ECMP inter-area route, we compute
a new route and check whether that already exists. If so, we keep the old
route and only update its nexthops. Previously, we merged the new route's
nexthops into the old one's, but this way, it's impossible to remove
nexthops from the old route, resulting in stale nexthops.

This commit fixes this by first removing all nexthops from the old route and
then copying all nexthops from the new route into it. If the new route has
fewer nexthops, the old one will have as well afterwards.

Signed-off-by: Martin Buck <mb-tmp-tvguho.pbz@gromit.dyndns.org>
2022-01-20 15:18:32 +01:00
Igor Ryzhov
860e740b36 bgpd: replace custom union gw_addr with struct ipaddr
BGP EVPN custom `union gw_addr` is basically the same thing as a common
`struct ipaddr` but it lacks the address family which is needed in some
cases.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-19 23:13:04 +03:00
Igor Ryzhov
b04c1e9997 bgpd: fix populating the attribute
This code is populating a temporary variable `add` instead of the attr.
Initially this variable was later copied to the attr but the copying was
erroneously deleted by 0a50c2481. Directly populate the attr to restore
the correct behavior.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-19 23:02:11 +03:00
Igor Ryzhov
8f2661b01d bgpd: remove wrong overlay index comparison
Here we try to compare the new attr with the existing one but this call
compares the existing index with zero instead. attrhash_cmp already
compares indexes using overlay_index_same so this call is both wrong and
useless.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2022-01-19 22:55:44 +03:00