Config:
vrf blue
ip msdp peer 1.1.1.1 source 1.1.1.1
frr-reload failure log:
2024-04-23 02:08:32,501 INFO: Failed to execute vrf blue no ip
msdp peer 1.1.1.1 source 1.1.1.1 exit
2024-04-23 02:08:32,501 ERROR: "vrf blue -- no ip msdp peer 1.1.1.1
source 1.1.1.1 -- exit" we failed to remove this command
2024-04-23 02:08:32,501 ERROR: % Unknown command: no ip msdp peer
1.1.1.1 source 1.1.1.1
Chirag Shah [Thu, 18 Apr 2024 18:44:00 +0000 (11:44 -0700)]
tools: fix pim interface config deletionII
When no ip pim is performed subsequent pim related
configs under the interface also implicitly deleted.
The previous fix was attempting to remove from the same
list which was being integrated.
First collect the lines to remove in separate list
then at the end remove from the original lines_to_del.
commit 623af04e1c does not work properly if tries to delete
an entry from existing list which is being walked on.
running-config:
--------------
interface swp1
ip pim
ip pim active-active
ip pim allow-rp rp-list sample
ip pim bfd
ip pim use-source 1.1.1.1
ip multicast boundary oil test
exit
frr-reload log pointing only no ip pim config
is removed under interface:
2024-04-18 18:44:37,202 INFO: "frr defaults datacenter" cannot be removed
2024-04-18 18:44:37,202 INFO: "service integrated-vtysh-config" cannot be removed
2024-04-18 18:44:37,504 INFO: Executed "interface swp1 no ip pim exit"
2024-04-18 18:44:37,505 INFO: /var/run/frr/reload-YHS51E.txt content
ad151f66aa ("bgpd: Refactor bgp_static_set/bgp_static_set_safi") merged
bgp_static_set_safi into bgp_static_set but inadvertently omitted the
handling of prd_pretty.
Donald Sharp [Fri, 19 Apr 2024 16:13:32 +0000 (12:13 -0400)]
lib, zebra: Check for not being a blackhole route
In zebra_interface_nhg_reinstall zebra is checking that the
nhg is a singleton and not a blackhole nhg. This was originally
done with checking that the nexthop is a NEXTHOP_TYPE_IFINDEX,
NEXTHOP_TYPE_IPV4_IFINDEX and NEXTHOP_TYPE_IPV6_IFINDEX. This
was excluding NEXTHOP_TYPE_IPV4 and NEXTHOP_TYPE_IPV6. These
were both possible to be received and maintained from the upper
level protocol for when a route is being recursively resolved.
If we have gotten to this point in zebra_interface_nhg_reinstall
the nexthop group has already been installed at least once
and we *know* that it is actually a valid nexthop. What the
test is really trying to do is ensure that we are not reinstalling
a blackhole nexthop group( Which is not possible to even be
here by the way, but safety first! ). So let's change
to test for that instead.
Piotr Suchy [Mon, 15 Apr 2024 19:33:40 +0000 (21:33 +0200)]
vtysh, lib: fix 'show ip[v6] prefix-list ... json' formatting by moving it to vtysh
Json output is not valid for 'show ip[v6] prefix-list ... json' commands,
as it goes through all the running daemons and for each one it calls
'vty_show_prefix_list' creating a new json object. To aggreagate the output
and create a valid json that can be parsed, the commands were moved to vtysh.
Christian Hopps [Sat, 20 Apr 2024 11:59:02 +0000 (07:59 -0400)]
yang: add missing `zif-gre` zebra interface type
This was caught by the grpc_basic test which was receiving an invalid error
result, which was returned b/c inside zebra the libyang code was flagging the
value as invalid for a derived zebra interface type.
vtysh: Fix `show route-map` command when calling via `do`
Before:
```
ton(config)# do sh route-map
% [ZEBRA] Unknown command: show route-map
% [BGP] Unknown command: show route-map
% [ISIS] Unknown command: show route-map
```
When a BFD down notification is received and the C-bit is set in both
directions, any ongoing graceful restart should be aborted and stale
routes removed from the RIB.
This commit updates the `bfd_bgp_cbit_topo3` topotest accordingly to
fix the expected outcomes in the `test_bfd_loss_intermediate` test.
ospfd: Add prefix-list filtering of OSPF neighbors on OSPF interface
This commit adds the capabiity to filter OSPF neighbors using a
prefix-list with rules matching the neighbor's IP source address.
Configuration, filtering, immediate neighbor pruning, topo-tests,
and documentation are included. The command is:
bgpd: Include capabilities when sending NOTIFICATION(7)
RFC5492 says:
This document defines a new Error Subcode, Unsupported Capability.
The value of this Subcode is 7. The Data field in the NOTIFICATION
message MUST list the set of capabilities that causes the speaker to
send the message. Each such capability is encoded in the same way as
it would be encoded in the OPEN message.
Donald Sharp [Wed, 17 Apr 2024 13:40:00 +0000 (09:40 -0400)]
bgpd: Allow specification of AS 0 for rpki commands
RFC-7607 specifically calls out the allowed usage
of AS 0 to signal that the a particular address is
not in use and should be guarded against. Add
the ability to specify this special AS in the rpki
commands.
Igor Ryzhov [Tue, 16 Apr 2024 19:10:45 +0000 (22:10 +0300)]
lib, zebra: fix exit commands
If a command is not marked as `YANG`-converted, the current command
batching buffer is flushed before executing the command. We shouldn't
flush the buffer when executing an `exit` command. It should only be
flushed if the next command is not `YANG`-converted, which is checked by
the command itself, not the previous `exit`.
Donald Sharp [Thu, 11 Apr 2024 14:46:46 +0000 (10:46 -0400)]
bgpd: Fix display when using `missing-as-worst`
The usage of the `bgp bestpath med missing-as-worst` command
was being accepted and applied during bestpath, but during output
of the routes affected by this it would not give any indication
that this was happening or what med value was being used.
Fixes: #15718 Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd: fix addressing information of non established outgoing sessions
When trying to connect to a BGP peer that does not respons, the 'show
bgp neighbors' command does not give any indication on the local and
remote addresses used:
> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
> Local Role: undefined
> Remote Role: undefined
> BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
> BGP state = Connect
> [..]
> Connections established 0; dropped 0
> Last reset 00:00:04, Waiting for peer OPEN (n/a)
> Internal BGP neighbor may be up to 255 hops away.
> BGP Connect Retry Timer in Seconds: 120
> Next connect timer due in 117 seconds
> Read thread: off Write thread: off FD used: 27
The addressing information (address and port) are only available
when TCP session is established, whereas this information is present
at the system level:
Add the display for outgoing BGP session, as the information in
the getsockname() API provides information for connected streams.
When getpeername() API does not give any information, use the peer
configuration (destination port is encoded in peer->port).
> # show bgp neighbors
> BGP neighbor is 192.0.2.150, remote AS 65500, local AS 65500, internal link
> Local Role: undefined
> Remote Role: undefined
> BGP version 4, remote router ID 0.0.0.0, local router ID 192.0.2.1
> BGP state = Connect
> [..]
> Connections established 0; dropped 0
> Last reset 00:00:16, Waiting for peer OPEN (n/a)
> Local host: 192.0.2.1, Local port: 46084
> Foreign host: 192.0.2.150, Foreign port: 179
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
bgpd: remove useless control checks about TCP connection
When attempting to get the src and destination addresses of a given
connection, the API may return the NULL pointer, but further code
in bgp_zebra_nexthop_set() already does a check about the given
pointer.
Relaxing the error code for all the returned adressing.
Fixes: 1ff9a340588a ("bgpd: bgpd-fsm-fix.patch") Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
ospfd: Fix compile warning with `-Wformat-truncation`
ospfd/ospf_sr.c: In function ‘show_sr_node.part.5’:
ospfd/ospf_sr.c:2745:32: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
snprintf(tmp, sizeof(tmp), "%u", i);
^~
ospfd/ospf_sr.c:2745:31: note: directive argument in the range [0, 2147483646]
snprintf(tmp, sizeof(tmp), "%u", i);
isisd: Fix compile warning with `-Wformat-truncation`
isisd/isis_spf.c: In function ‘show_isis_route_common’:
isisd/isis_spf.c:3034:39: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 2 [-Wformat-truncation=]
snprintf(key, sizeof(key), "level-%d", level);
^~
isisd/isis_spf.c:3034:32: note: directive argument in the range [1, 2147483646]
snprintf(key, sizeof(key), "level-%d", level);
^~~~~~~~~~
bgpd: prompt should be given only for the real change
Prompt nothing for an empty (and failed) operation. Take
`bgp graceful-restart` as an example:
Before:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)#
```
After:
```
anlan(config-router)# bgp graceful-restart
Graceful restart configuration changed, reset all peers to take effect
anlan(config-router)# bgp graceful-restart
anlan(config-router)#
```
The same command should be accepted, it is an empty operation. Take
`neighbor <X> graceful-restart-helper` as an example:
Before:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
% The Graceful Restart command used is not valid at this moment.
anlan(config-router)#
```
After:
```
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)# neighbor 3.3.3.3 graceful-restart-helper
Graceful restart configuration changed, reset this peer to take effect
anlan(config-router)#
```
Donald Sharp [Thu, 11 Apr 2024 17:28:30 +0000 (13:28 -0400)]
bgpd: Increase install/uninstall speed of evpn vpn vni's
BGP receives notification from zebra about an vpn that
needs to be installed into the evpn tables. Unfortunately
this function was walking the entirety of evpn tables
3 times. Modify the code to walk the tree 1 time and
to just look for the needed route types as you go.
This reduces, in a scaled environment, processing
time of the zclient_read function from 130 seconds
to 95 seconds. For a up / down / up interface
scenario.
Signed-off-by: Rajasekar Raja <rajasekarr@vndia.com> Signed-off-by: Donald Sharp <sharpd@nvidia.com>