]> git.puffer.fish Git - mirror/frr.git/log
mirror/frr.git
2 years agoospfd: catch and report runt LSAs 12215/head
Lou Berger [Fri, 28 Oct 2022 16:06:04 +0000 (16:06 +0000)]
ospfd: catch and report runt LSAs

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoospfd: remove assert on zero length LSA - which is permitted by spec
Lou Berger [Thu, 27 Oct 2022 19:12:23 +0000 (19:12 +0000)]
ospfd: remove assert on zero length LSA - which is permitted by spec

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoMerge pull request #12211 from SaiGomathiN/coverity
Donatas Abraitis [Thu, 27 Oct 2022 17:04:21 +0000 (18:04 +0100)]
Merge pull request #12211 from SaiGomathiN/coverity

pimd: fixing some coverity issues

2 years agoMerge pull request #12212 from donaldsharp/clarify_issue
Donatas Abraitis [Thu, 27 Oct 2022 17:01:44 +0000 (18:01 +0100)]
Merge pull request #12212 from donaldsharp/clarify_issue

bgpd: Clarify what NHT error message means

2 years agoMerge pull request #12200 from patrasar/pimv6_rp_iif_fix
Donatas Abraitis [Thu, 27 Oct 2022 16:59:50 +0000 (17:59 +0100)]
Merge pull request #12200 from patrasar/pimv6_rp_iif_fix

pimd, pim6d: Fix rp-info OIF having PIM disabled interface

2 years agoMerge pull request #12210 from louis-6wind/fix-link-params-coverity
Olivier Dugeon [Thu, 27 Oct 2022 14:01:42 +0000 (16:01 +0200)]
Merge pull request #12210 from louis-6wind/fix-link-params-coverity

lib: fix coverity scan failure in zebra_interface_link_params_read()

2 years agobgpd: Clarify what NHT error message means 12212/head
Donald Sharp [Thu, 27 Oct 2022 13:21:41 +0000 (09:21 -0400)]
bgpd: Clarify what NHT error message means

When waiting on a path to reach the peer, modify the debug/show
output to give a better understanding to the operator about what
they should be looking for.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopimd: Dereference before null check 12211/head
Sai Gomathi N [Thu, 27 Oct 2022 09:36:00 +0000 (02:36 -0700)]
pimd: Dereference before null check

In pim_ecmp_nexthop_search: All paths that lead to this null pointer comparison already dereference the pointer earlier
There may be a null pointer dereference, or else the comparison against null is unnecessary.

Coverity CID-1519749

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agopimd: Unchecked return value
Sai Gomathi N [Thu, 27 Oct 2022 08:52:31 +0000 (01:52 -0700)]
pimd: Unchecked return value

In tib_sg_oil_setup: Value returned from a function is not checked for errors before being used.
If the function returns an error value, the error value may be mistaken for a normal value.
Here, only the nexthop value is being used. So casted the return type to void.

Coverity CID-1519816

Signed-off-by: Sai Gomathi N <nsaigomathi@vmware.com>
2 years agolib: fix coverity scan failure in zebra_interface_link_params_read() 12210/head
Louis Scalbert [Thu, 27 Oct 2022 08:11:25 +0000 (10:11 +0200)]
lib: fix coverity scan failure in zebra_interface_link_params_read()

The code was working but the coverity scan reported a failure.

Clarify the code to make the coverity scan happy.

Fixes: fe0a129687 ("lib,zebra: link-params are not flushed after no enable")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #12205 from proelbtn/fix-ipv4-vpn-nexthop-over-ipv6-peer
Donatas Abraitis [Thu, 27 Oct 2022 06:47:24 +0000 (07:47 +0100)]
Merge pull request #12205 from proelbtn/fix-ipv4-vpn-nexthop-over-ipv6-peer

bgpd: Fix the condition whether nexthop is changed

2 years agoMerge pull request #12204 from taspelund/soo_ip_fix
Donatas Abraitis [Thu, 27 Oct 2022 06:27:41 +0000 (07:27 +0100)]
Merge pull request #12204 from taspelund/soo_ip_fix

bgpd: Check for IP-format Site-of-Origin

2 years agoMerge pull request #12201 from donaldsharp/clang-16-robots
Jafar Al-Gharaibeh [Thu, 27 Oct 2022 04:07:05 +0000 (23:07 -0500)]
Merge pull request #12201 from donaldsharp/clang-16-robots

Clang 16 robots

2 years agoMerge pull request #12190 from manojvn/468074
Jafar Al-Gharaibeh [Thu, 27 Oct 2022 04:05:47 +0000 (23:05 -0500)]
Merge pull request #12190 from manojvn/468074

ospf6d: Fix for memory leak issues in ospf6.

2 years agoMerge pull request #12179 from LabNConsulting/working/lb/p2mp-improvements
Jafar Al-Gharaibeh [Thu, 27 Oct 2022 03:46:10 +0000 (22:46 -0500)]
Merge pull request #12179 from LabNConsulting/working/lb/p2mp-improvements

  ospf: optimization for FRR's P2MP mode

2 years agobgpd: Fix the condition whether nexthop is changed 12205/head
Ryoga Saito [Thu, 27 Oct 2022 01:17:50 +0000 (10:17 +0900)]
bgpd: Fix the condition whether nexthop is changed

Given that the following topology, route server MUST not modify NEXT_HOP
attribute because route server isn't in the actual routing path. This
behavior is required to comply RFC7947

(Router A) <-(eBGP peer)-> (Route Server) <-(eBGP peer)-> (Router B)

RFC7947 says as follows:

> As the route server does not participate in the actual routing of
> traffic, the NEXT_HOP attribute MUST be passed unmodified to the route
> server clients, similar to the "third-party" next-hop
> feature described in Section 5.1.3. of [RFC4271].

However, current FRR is violating RFC7947 in some cases. If routers and
route server established BGP peer over IPv6 connection and routers
advertise ipv4-vpn routes through route server, route server will modify
NEXT_HOP attribute in these advertisements.

This is because the condition to check whether NEXT_HOP attribute should
be changed or not is wrong. We should use (afi, safi) as the key to
check, but (nhafi, safi) is actually used. This causes the RFC7947
violation.

Signed-off-by: Ryoga Saito <ryoga.saito@linecorp.com>
2 years agobgpd: Check for IP-format Site-of-Origin 12204/head
Trey Aspelund [Wed, 26 Oct 2022 20:53:09 +0000 (20:53 +0000)]
bgpd: Check for IP-format Site-of-Origin

When deciding whether to apply "neighbor soo" filtering towards a peer,
we were only looking for SoO ecoms that use either AS or AS4 encoding.
This makes sure we also check for IPv4 encoding, since we allow a user
to configure that encoding style against the peer.

Config:
```
router bgp 1
 address-family ipv4 unicast
  network 100.64.0.2/32 route-map soo-foo
  neighbor 192.168.122.12 soo 3.3.3.3:20
 exit-address-family
!
route-map soo-foo permit 10
 set extcommunity soo 3.3.3.3:20
exit
```

Before:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i
*> 100.64.0.2/32    0.0.0.0                  0    100  32768 i

Total number of prefixes 2
```

After:
```
ub20# show ip bgp neighbors 192.168.122.12 advertised-routes
BGP table version is 5, local router ID is 100.64.0.222, vrf id 0
Default local pref 100, local AS 1
Status codes:  s suppressed, d damped, h history, * valid, > best, = multipath,
               i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes:  i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

    Network          Next Hop            Metric LocPrf Weight Path
*> 2.2.2.2/32       0.0.0.0                  0    100  32768 i

Total number of prefixes 1
```

Signed-off-by: Trey Aspelund <taspelund@nvidia.com>
2 years agoMerge pull request #12199 from tewok/frr-routes-table-columns
Russ White [Wed, 26 Oct 2022 13:48:41 +0000 (09:48 -0400)]
Merge pull request #12199 from tewok/frr-routes-table-columns

bgpd: fixed misaligned columns in BGP routes table

2 years agoospf6d: Make ospf6d happy with clang-16 12201/head
Donald Sharp [Wed, 26 Oct 2022 11:41:03 +0000 (07:41 -0400)]
ospf6d: Make ospf6d happy with clang-16

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agoldpd: Make ldpd happy with clang-16
Donald Sharp [Wed, 26 Oct 2022 11:40:48 +0000 (07:40 -0400)]
ldpd: Make ldpd happy with clang-16

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2 years agopimd: Make pimd happy with clang-16
Donald Sharp [Wed, 26 Oct 2022 11:39:47 +0000 (07:39 -0400)]
pimd: Make pimd happy with clang-16

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2 years agopathd: Make pathd happy with clang-16
Donald Sharp [Wed, 26 Oct 2022 11:39:14 +0000 (07:39 -0400)]
pathd: Make pathd happy with clang-16

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2 years agopimd, pim6d: Fix rp-info OIF having PIM disabled interface 12200/head
Sarita Patra [Wed, 26 Oct 2022 04:25:23 +0000 (21:25 -0700)]
pimd, pim6d: Fix rp-info OIF having PIM disabled interface

Problem:
frr(config)# show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

frr(config)# int ens192
frr(config-if)# no ip pim

frr(config) show ip pim rp-info
RP address group/prefix-list OIF I am RP Source Group-Type
109.0.0.3 224.0.0.0/4 ens192 no Static ASM

rp-info OIF is still having ens192 which is PIM disabled.
Fixing this as part of this PR.

Issue: #12044

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agoisisd: Make clang-16 compiler happy with isisd
Donald Sharp [Wed, 26 Oct 2022 00:06:49 +0000 (20:06 -0400)]
isisd: Make clang-16 compiler happy with isisd

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2 years agopceplib: Fix clang-16 not happy with build
Donald Sharp [Wed, 26 Oct 2022 00:04:43 +0000 (20:04 -0400)]
pceplib: Fix clang-16 not happy with build

In this case it was functions without a prototype

Signed-off-by: Donald Sharp <donaldsharp72@gmail.com>
2 years agoMerge pull request #12166 from anlancs/fix/bgpd-wildcard
Russ White [Tue, 25 Oct 2022 15:34:38 +0000 (11:34 -0400)]
Merge pull request #12166 from anlancs/fix/bgpd-wildcard

bgpd: return failure for wildcard ERT

2 years agoospf: optimization for FRR's P2MP mode 12179/head
Lou Berger [Fri, 21 Oct 2022 20:35:13 +0000 (20:35 +0000)]
ospf: optimization for FRR's P2MP mode

FRR implements a non-standard, but compatible approach for
sending update LSAs (it always send to 224.0.0.5) on P2MP
interfaces. This change makes it so acks are also sent to
224.0.0.5.

Since the acks are multicast, this allows an optimization
where we don't send back out the incoming P2MP interface
immediately allow time to rx multicast ack from neighbors
on the same net that rx'ed the original (multicast) update.

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agotopotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info
Lou Berger [Fri, 21 Oct 2022 16:44:45 +0000 (16:44 +0000)]
topotests: test_ospf_p2mp.py - check for full adjacencies and basic DB info

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoMerge pull request #12187 from mjstapp/mjs_fix_bgp_allowas
Russ White [Tue, 25 Oct 2022 15:26:06 +0000 (11:26 -0400)]
Merge pull request #12187 from mjstapp/mjs_fix_bgp_allowas

bgpd: fix unconfig of allowas_in; add to show output

2 years agoMerge pull request #12184 from nberlee/master
mobash-rasool [Tue, 25 Oct 2022 15:23:50 +0000 (20:53 +0530)]
Merge pull request #12184 from nberlee/master

vtysh: Ensure an empty string does not get printed for host/domain

2 years agobgpd: fixed misaligned columns in BGP routes table 12199/head
Wayne Morrison [Tue, 25 Oct 2022 14:45:35 +0000 (10:45 -0400)]
bgpd: fixed misaligned columns in BGP routes table

Column headers in BGP routes table are not aligned with data when
RPKI status is available.  This was fixed to insert a space at the
beginning of the header and at the beginning of lines that do not
have RPKI status.

This fix requires that several testing templates be adjusted to
match the new output.

Signed-off-by: Wayne Morrison <wmorrison@netgate.com>
2 years agoMerge pull request #12069 from opensourcerouting/fix/local-as_reset
Russ White [Tue, 25 Oct 2022 13:50:24 +0000 (09:50 -0400)]
Merge pull request #12069 from opensourcerouting/fix/local-as_reset

bgpd: Reuse flag action for reseting session for `neighbor PEER local-as`

2 years agoMerge pull request #12142 from opensourcerouting/fix/sendholdtimer
Russ White [Tue, 25 Oct 2022 13:46:48 +0000 (09:46 -0400)]
Merge pull request #12142 from opensourcerouting/fix/sendholdtimer

bgpd: Honor default holdtime when triggering session reset for SendHoldTimer

2 years agoMerge pull request #12151 from louis-6wind/fix-mpls-te
Olivier Dugeon [Tue, 25 Oct 2022 11:51:24 +0000 (13:51 +0200)]
Merge pull request #12151 from louis-6wind/fix-mpls-te

isisd: fixes for mpls-te

2 years agoMerge pull request #12125 from louis-6wind/fix-link-params
Olivier Dugeon [Tue, 25 Oct 2022 08:53:23 +0000 (10:53 +0200)]
Merge pull request #12125 from louis-6wind/fix-link-params

lib,zebra,ospf: link-params are not flushed after "no enable"

2 years agoospf6d: Fix for memory leak issues in ospf6. 12190/head
Manoj Naragund [Tue, 25 Oct 2022 07:43:10 +0000 (00:43 -0700)]
ospf6d: Fix for memory leak issues in ospf6.

Problem:
Multiple memory leaks in ospf6.

 260 ==6637== 32 bytes in 1 blocks are definitely lost in loss record 5 of 24
 261 ==6637==    at 0x4C31FAC: calloc (vg_replace_malloc.c:762)
 262 ==6637==    by 0x4E8A1BF: qcalloc (memory.c:111)
 263 ==6637==    by 0x11EE27: ospf6_summary_add_aggr_route_and_blackhole (ospf6_asbr.c:2779)
 264 ==6637==    by 0x11EEBA: ospf6_originate_new_aggr_lsa (ospf6_asbr.c:2811)
 265 ==6637==    by 0x4E7C6A7: hash_clean (hash.c:325)
 266 ==6637==    by 0x11FA93: ospf6_handle_external_aggr_update (ospf6_asbr.c:3164)
 267 ==6637==    by 0x11FA93: ospf6_asbr_summary_process (ospf6_asbr.c:3386)
 268 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 269 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 270 ==6637==    by 0x119535: main (ospf6_main.c:228)

 356 ==6637== 240 bytes in 12 blocks are indirectly lost in loss record 13 of 24
 357 ==6637==    at 0x4C2FE96: malloc (vg_replace_malloc.c:309)
 358 ==6637==    by 0x4E8A0DA: qmalloc (memory.c:106)
 359 ==6637==    by 0x13545C: ospf6_lsa_alloc (ospf6_lsa.c:724)
 360 ==6637==    by 0x1354E3: ospf6_lsa_create_headeronly (ospf6_lsa.c:756)
 361 ==6637==    by 0x1355F2: ospf6_lsa_copy (ospf6_lsa.c:790)
 362 ==6637==    by 0x13B58B: ospf6_dbdesc_recv_slave (ospf6_message.c:976)
 363 ==6637==    by 0x13B58B: ospf6_dbdesc_recv (ospf6_message.c:1038)
 364 ==6637==    by 0x13B58B: ospf6_read_helper (ospf6_message.c:1838)
 365 ==6637==    by 0x13B58B: ospf6_receive (ospf6_message.c:1875)
 366 ==6637==    by 0x4EB739B: thread_call (thread.c:1692)
 367 ==6637==    by 0x4E85B17: frr_run (libfrr.c:1068)
 368 ==6637==    by 0x119535: main (ospf6_main.c:228)

RCA:
1. when the ospf6 area is being deleted, the neighbor related information
   was not being cleaned up.
2. when aggr route gets deleted from rt_aggr_tbl the corrsponding summary
   route attched to the aggr route was not being deleted.

Fix:
Added the ospf6_neighbor_delete in ospf6_area_delete to free the
neighbor related information and added ospf6_route_delete while
freeing external aggr route to free the summary route.

Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2 years agovtysh: Ensure an empty string does not get printed for host/domain 12184/head
Nico Berlee [Sun, 23 Oct 2022 14:42:51 +0000 (16:42 +0200)]
vtysh: Ensure an empty string does not get printed for host/domain

vtysh show running-config is showing:
frr version 8.3.1_git
frr defaults traditional
hostname test
log file /etc/frr/frr.log informational
log timestamp precision 3
domainname
service integrated-vtysh-config

domainname should not be printed in this case at all. If the
host has no search/domainname configured, frr_reload.py
crashes on invalid config from `vtysh show running-config`

Basically the same change as commit a7141b8

Signed-off-by: Nico Berlee <nico.berlee@on2it.net>
2 years agobgpd: fix config of allowas_in; add to show output 12187/head
Mark Stapp [Thu, 20 Oct 2022 20:47:12 +0000 (16:47 -0400)]
bgpd: fix config of allowas_in; add to show output

Ensure that un-configuring allowas-in for a peer or group
clears the related flags and integer value. Tighten the use
of the integer counter so that it's only used when the config
flag is set. Add show output if allowas-in is enabled.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
2 years agoMerge pull request #11673 from cscarpitta/srv6-per-vrf-sid
Donatas Abraitis [Mon, 24 Oct 2022 14:30:10 +0000 (17:30 +0300)]
Merge pull request #11673 from cscarpitta/srv6-per-vrf-sid

bgpd: add support for SRv6 L3VPN for IPv4 and IPv6 address families using a single SID

2 years agobgpd: return failure for wildcard ERT 12166/head
anlan_cs [Fri, 21 Oct 2022 05:17:29 +0000 (01:17 -0400)]
bgpd: return failure for wildcard ERT

The "RTLIST..." list should be maintained integrity. If wildcard check
failed, it should immediately return failure. Otherwise user configuration
will be partial.

```
anlan(config-router-af)# route-target export *:55 33:33
% Wildcard '*' only applicable for import
anlan(config-router-af)# route-target both *:55 33:33
% Wildcard '*' only applicable for import
```

With this commit, the RTs without wildcard will not be executed as before. And
the same for `no` form.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
2 years agoisisd: fix recreating the LS TED after re-enabling MPLS TE 12151/head
Louis Scalbert [Mon, 17 Oct 2022 16:40:42 +0000 (18:40 +0200)]
isisd: fix recreating the LS TED after re-enabling MPLS TE

When disabling and re-enabling the "mpls-te on" command, the LS TED
database is deleted but not re-created.

Cleanup the LS TED database instead of deleting it when disabling
"mpls-te".

Fixes: 1fa6385040.. ("isisd: Correct Valgrind errors")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoisisd: fix sending remote interface ip address after enabling MPLS TE
Louis Scalbert [Mon, 17 Oct 2022 15:35:12 +0000 (17:35 +0200)]
isisd: fix sending remote interface ip address after enabling MPLS TE

If MPLS TE is enabled, the router encodes the local and remote interface
IP address in the "Extended Reachability" TLV.

> east-vm(config)# do show isis database detail east-vm.00-00
>  Extended Reachability: 0007.e901.3333.00 (Metric: 10)
>    Local Interface IP Address(es): 10.126.0.2
>    Remote Interface IP Address(es): 10.126.0.3
>    Maximum Bandwidth: 1.76258e+08 (Bytes/sec)

The remote interface is added when the circuit adjacency comes up after
setting MPLS TE. However, if MPLS TE is enabled after, the remote
address is not added. It happens after disabling and re-enabling the
MPLS TE.

> east-vm(config)# router isis 1
> east-vm(config-router)# no mpls on
> east-vm(config-router)# mpls on
> east-vm(config)# do show isis database detail east-vm.00-00
>  Extended Reachability: 0007.e901.3333.00 (Metric: 10)
>    Local Interface IP Address(es): 10.126.0.2
>    Maximum Bandwidth: 1.76258e+08 (Bytes/sec)

Update the remote IPv4 and IPv6 of all adjacencies after enabling MPLS
TE.

Fixes: 1b3f47d04c ("isisd: Update TLVs processing for TE, RI & SR")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
2 years agoMerge pull request #12026 from kuldeepkash/bgp_local_asn
Donatas Abraitis [Mon, 24 Oct 2022 06:16:59 +0000 (09:16 +0300)]
Merge pull request #12026 from kuldeepkash/bgp_local_asn

tests: Add bgp local asn test suite

2 years agoMerge pull request #12173 from sworleys/VNI-chrstr-Fix
Donatas Abraitis [Mon, 24 Oct 2022 05:59:17 +0000 (08:59 +0300)]
Merge pull request #12173 from sworleys/VNI-chrstr-Fix

bgpd: fix vni_str NULL check in evpn rt show run

2 years agoMerge pull request #12178 from opensourcerouting/fix/revert_13111667513a0f91a8e875cdf...
Donald Sharp [Sun, 23 Oct 2022 19:13:26 +0000 (15:13 -0400)]
Merge pull request #12178 from opensourcerouting/fix/revert_13111667513a0f91a8e875cdf12c940ea2b60b05

Revert "doc: Add `neighbor PEER extended-optional-parameters` command"

2 years agoRevert "doc: Add `neighbor PEER extended-optional-parameters` command" 12178/head
Donatas Abraitis [Fri, 21 Oct 2022 18:45:29 +0000 (21:45 +0300)]
Revert "doc: Add `neighbor PEER extended-optional-parameters` command"

I don't know how I missed that it was already defined. Let's just revert it.

This reverts commit 13111667513a0f91a8e875cdf12c940ea2b60b05.

2 years agobgpd: fix vni_str NULL check in evpn rt show run 12173/head
Stephen Worley [Fri, 21 Oct 2022 15:18:12 +0000 (11:18 -0400)]
bgpd: fix vni_str NULL check in evpn rt show run

Fix the vni_str NULL check for wildcard route-targets
in evpn show run. This will never be NULL if we add 1
here. Though it should also never be NULL since ":" should
always exist. Better to be safe than sorry.

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2 years agoMerge pull request #12094 from patrasar/pimv6_rp_linklocal
Donatas Abraitis [Fri, 21 Oct 2022 07:34:28 +0000 (10:34 +0300)]
Merge pull request #12094 from patrasar/pimv6_rp_linklocal

pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP

2 years agoMerge pull request #11600 from patrasar/pimv6_bsm_clis
Donatas Abraitis [Fri, 21 Oct 2022 06:41:22 +0000 (09:41 +0300)]
Merge pull request #11600 from patrasar/pimv6_bsm_clis

pim6d:  BSM CLIs implementation

2 years agoMerge pull request #12140 from opensourcerouting/fix/watchfrr_dont_givup
Jafar Al-Gharaibeh [Fri, 21 Oct 2022 04:46:47 +0000 (23:46 -0500)]
Merge pull request #12140 from opensourcerouting/fix/watchfrr_dont_givup

watchfrr: Delay restart_kill if still reading configuration

2 years agoMerge pull request #12160 from donaldsharp/debug_nh_fix
Jafar Al-Gharaibeh [Fri, 21 Oct 2022 04:43:46 +0000 (23:43 -0500)]
Merge pull request #12160 from donaldsharp/debug_nh_fix

Debug nh fix

2 years agotests: Add lib changes to support bgp local asn feature 12026/head
Kuldeep Kashyap [Tue, 27 Sep 2022 03:27:02 +0000 (08:57 +0530)]
tests: Add lib changes to support bgp local asn feature

Added lib changes to support bgp local
asn feature config changes

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agotests: Add bgp local asn test suite
Kuldeep Kashyap [Tue, 27 Sep 2022 03:25:28 +0000 (08:55 +0530)]
tests: Add bgp local asn test suite

Adding test to verify functionality
of local asn bgp feature.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
2 years agoMerge pull request #12155 from LabNConsulting/working/lb/opaque-lsa-zero-len
Jafar Al-Gharaibeh [Thu, 20 Oct 2022 14:19:45 +0000 (09:19 -0500)]
Merge pull request #12155 from LabNConsulting/working/lb/opaque-lsa-zero-len

OSPF: allow for zero length opaque LSAs

2 years agolib: Remove unnecessary comparison, for linked list 12160/head
Donald Sharp [Wed, 19 Oct 2022 16:57:28 +0000 (12:57 -0400)]
lib: Remove unnecessary comparison, for linked list

In the comparison function for a linked list code was
always checking against passed in NULL's.  The comparison
function will never receive a NULL value for data from
the linklist.c code.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agozebra: Fix debug of filtering out prefix due to routemap
Donald Sharp [Wed, 19 Oct 2022 16:44:55 +0000 (12:44 -0400)]
zebra: Fix debug of filtering out prefix due to routemap

The debug for notification about a filtered prefix was
just printing the nexthop ifindex and vrf id.  Not all
nexthops have this data.  Just print out the actual nexthop

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2 years agopimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP 12094/head
Sarita Patra [Tue, 11 Oct 2022 01:38:14 +0000 (18:38 -0700)]
pimd, pim6d: Don't configure link-local, Multicast, Unspecified address as RP

Problem:
=======
frr(config)# do show ipv6 pim interface
 Interface  State  Address                   PIM Nbrs  PIM DR  FHR  IfChannels
 ens192     up     fe80::250:56ff:feb7:3619  0         local   0    1

Configure ens192 interface link-local address as RP.
frr(config)# ipv6 pim rp fe80::250:56ff:feb7:3619
No Path to RP address specified: fe80::250:56ff:feb7:3619

frr(config)# do show ipv6 pim rp-info
 RP address                group/prefix-list  OIF      I am RP  Source  Group-Type
 fe80::250:56ff:feb7:3619  ff00::/8           Unknown  yes      Static  ASM

Fix:
===
RP should not be link-local, multicast and unspecified address.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd, pim6d: Define pim_addr_is_multicast API
Sarita Patra [Thu, 13 Oct 2022 04:37:28 +0000 (21:37 -0700)]
pimd, pim6d: Define pim_addr_is_multicast API

pim_addr_is_multicast API will check if the address is multicast
address or not.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Update BSM cli/show/debug commands in pimv6.rst 11600/head
Sarita Patra [Thu, 14 Jul 2022 12:11:51 +0000 (05:11 -0700)]
pim6d: Update BSM cli/show/debug commands in pimv6.rst

Update the below commands in pimv6.rst
ipv6 pim bsm
ipv6 unicast-bsm
show ipv6 pim bsr
show ipv6 pim bsrp-info
show ipv6 pim bsm-database
debug pimv6 bsm

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add "show ipv6 pim bsrp-info [vrf NAME] [json]" cli
Sarita Patra [Tue, 12 Jul 2022 14:44:40 +0000 (07:44 -0700)]
pim6d: Add "show ipv6 pim bsrp-info [vrf NAME] [json]" cli

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add "[no] debug pimv6 bsm" cli
Sarita Patra [Tue, 12 Jul 2022 13:48:33 +0000 (06:48 -0700)]
pim6d: Add "[no] debug pimv6 bsm" cli

The cli "[no] debug pimv6 bsm" is used to enable/
disable bsm debugs for PIMV6

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add "show ipv6 show ip pim bsm-database [vrf NAME] [json]" cli
Sarita Patra [Tue, 12 Jul 2022 13:43:10 +0000 (06:43 -0700)]
pim6d: Add "show ipv6 show ip pim bsm-database [vrf NAME] [json]" cli

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd: Move "show ip pim bsm-database" cmd to DEFPY
Sarita Patra [Tue, 12 Jul 2022 13:39:56 +0000 (06:39 -0700)]
pimd: Move "show ip pim bsm-database" cmd to DEFPY

Added common pim_show_bsm_db_helper to suppport both PIM and
PIMV6.
pim_show_bsm_db is moved to pim_cmd_common.c file.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd: Move "show ip pim bsrp-info [vrf] [json]" cmd to DEFPY
Sarita Patra [Tue, 12 Jul 2022 14:15:07 +0000 (07:15 -0700)]
pimd: Move "show ip pim bsrp-info [vrf] [json]" cmd to DEFPY

Added pim_show_group_rp_mappings_info_helper to suppport both PIM and
PIMV6.
pim_show_group_rp_mappings_info() is moved to pim_cmd_common.c file.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add "show ipv6 pim bsr [vrf NAME] [json] cmd"
Sarita Patra [Tue, 12 Jul 2022 11:23:34 +0000 (04:23 -0700)]
pim6d: Add "show ipv6 pim bsr [vrf NAME] [json] cmd"

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopimd: Add vrf optional parameter in "show ip pim bsr" cmd
Sarita Patra [Tue, 12 Jul 2022 11:16:17 +0000 (04:16 -0700)]
pimd: Add vrf optional parameter in "show ip pim bsr" cmd

Added common API pim_show_bsr_helper to suppport both PIM and
PIMV6.
pim_show_bsr() is moved to pim_cmd_common.c file.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add [no] ipv6 pim unicast-bsm" command
Sarita Patra [Tue, 12 Jul 2022 10:49:48 +0000 (03:49 -0700)]
pim6d: Add [no] ipv6 pim unicast-bsm" command

Introduced common api pim_process_unicast_bsm_cmd,
pim_process_no_unicast_bsm_cmd which will process
both "[no] ip pim unicast-bsm" command and "[no] ipv6 pim
unicast-bsm" command.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agopim6d: Add [no] ipv6 pim bsm" command
Sarita Patra [Tue, 12 Jul 2022 10:45:14 +0000 (03:45 -0700)]
pim6d: Add [no] ipv6 pim bsm" command

Introduced common api pim_process_bsm_cmd,
pim_process_no_bsm_cmd which will process
both "[no] ip pim bsm" command and "[no] ipv6 pim
bsm" command.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agoMerge pull request #12144 from patrasar/v4-over-v6_nh
Donatas Abraitis [Thu, 20 Oct 2022 07:06:55 +0000 (10:06 +0300)]
Merge pull request #12144 from patrasar/v4-over-v6_nh

pimd: Fix v4-over-v6 nexthop handling

2 years agotopotests: ospfapi - enahnce test to cover explicit delete and 0 len opaque LSAs 12155/head
Lou Berger [Wed, 19 Oct 2022 13:07:02 +0000 (13:07 +0000)]
topotests: ospfapi - enahnce test to cover explicit delete and 0 len opaque LSAs

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoospfclient: add 'wait,<seconds>' action to ospfclient.py - for testing
Lou Berger [Wed, 19 Oct 2022 11:52:30 +0000 (11:52 +0000)]
ospfclient: add 'wait,<seconds>' action to ospfclient.py - for testing

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoospfd: allow for zero length opaque LSAs (which is permitted per RFC 5250)
Lou Berger [Wed, 19 Oct 2022 11:50:41 +0000 (11:50 +0000)]
ospfd: allow for zero length opaque LSAs (which is permitted per RFC 5250)

Signed-off-by: Lou Berger <lberger@labn.net>
2 years agoMerge pull request #12146 from rgirada/frr_gr
Donatas Abraitis [Wed, 19 Oct 2022 07:10:50 +0000 (10:10 +0300)]
Merge pull request #12146 from rgirada/frr_gr

ospf6d: adding missing json fields

2 years agoMerge pull request #12124 from anlancs/ospfd-len frr-8.4-rc
Russ White [Tue, 18 Oct 2022 15:40:21 +0000 (11:40 -0400)]
Merge pull request #12124 from anlancs/ospfd-len

ospfd: pass the length of string to function

2 years agozebra: Do not allow SRv6 func_bit_len > 20 11673/head
Carmine Scarpitta [Thu, 6 Oct 2022 15:26:57 +0000 (17:26 +0200)]
zebra: Do not allow SRv6 func_bit_len > 20

Currently, the SID transposition algorithm implemented in bgpd handles
incorrectly the SRv6 locators with function length greater than 20 bits.
To prevent issues, we currently limit the function length to 20 bits.

This limit will be removed when the bgpd SID transposition is fixed.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra: Ensure SRv6 SID length does not exceed 128
Carmine Scarpitta [Tue, 23 Aug 2022 14:20:07 +0000 (16:20 +0200)]
zebra: Ensure SRv6 SID length does not exceed 128

According to RFC 8986, the SRv6 SID length cannot exceed 128 bits. This
commit ensures that the condition
`block_len + node_len + function_len + arg_len <= 128` is satisfied when
a new SRv6 locator is created.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agotests: Add tests for `no sid vpn per-vrf export`
Carmine Scarpitta [Tue, 23 Aug 2022 14:13:42 +0000 (16:13 +0200)]
tests: Add tests for `no sid vpn per-vrf export`

This commit extends the `bgp_srv6l3vpn_to_bgp_vrf3` topotest by adding
two tests:
* prevent bgpd from exporting routes from a VRF to the VPN RIB
  (`no sid vpn per-vrf export`);
* enable bgpd to export routes from a VRF to the VPN RIB
  (`sid vpn per-vrf export auto`).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: Add `no sid vpn per-vrf export` command
Carmine Scarpitta [Tue, 23 Aug 2022 14:04:06 +0000 (16:04 +0200)]
bgpd: Add `no sid vpn per-vrf export` command

The command `sid vpn per-vrf export (1-255)|auto` can be used to export
IPv4 and IPv6 routes from a VRF to the VPN RIB using a single SRv6 SID
(End.DT46 behavior).

This commit implements the no form of the above command, which can be
used to disable the export of the IPv4/IPv6 routes:
`no sid vpn per-vrf export`.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agodoc: add doc for "sid vpn per-vrf export" command
Carmine Scarpitta [Sat, 23 Jul 2022 18:14:51 +0000 (20:14 +0200)]
doc: add doc for "sid vpn per-vrf export" command

This command adds the documentation for the "sid vpn per-vrf export (1..255)|auto" command to bgpd.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: add per-VRF SID to the bgpd configuration
Carmine Scarpitta [Sat, 23 Jul 2022 17:58:58 +0000 (19:58 +0200)]
bgpd: add per-VRF SID to the bgpd configuration

This commit adds the per-VRF SID chosen to advertise L3VPN for IPv4 and IPv6 address families using a single SID to the bgpd configuration.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agodoc: extend documentation of SRv6 locator
Carmine Scarpitta [Sat, 23 Jul 2022 16:48:42 +0000 (18:48 +0200)]
doc: extend documentation of SRv6 locator

This commit adds the documentation of the two optional parameters "block-len" and "node-len" of the SRv6 locator.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agodoc: add docs for End.DT46 seg6local route
Carmine Scarpitta [Sat, 23 Jul 2022 16:39:16 +0000 (18:39 +0200)]
doc: add docs for End.DT46 seg6local route

This commit adds the documentation for End.DT46 seg6local route to sharpd.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agotests: add new topotest to verify SRv6 locators
Carmine Scarpitta [Sat, 23 Jul 2022 16:30:03 +0000 (18:30 +0200)]
tests: add new topotest to verify SRv6 locators

This commit adds a new topotest to verify the functionality of SRv6
locators with custom bits length parameters.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agotests: add new topotest for SRv6-L3VPN (IPv4/IPv6)
Carmine Scarpitta [Sat, 23 Jul 2022 16:26:50 +0000 (18:26 +0200)]
tests: add new topotest for SRv6-L3VPN (IPv4/IPv6)

This commit adds a new topotest which tests SRv6 L3VPN for IPv4 and
IPv6 address families using a single SID.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agotests: add test for SRv6 End.DT46 behavior
Carmine Scarpitta [Sat, 23 Jul 2022 16:21:24 +0000 (18:21 +0200)]
tests: add test for SRv6 End.DT46 behavior

This commit adds a new test case to the
test_zebra_seg6local_route topotest. The new test case performs two
operations:
* try to install a seg6local route with an End.DT46 action
* verify that the route is created correctly

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agosharpd: add support for SRv6 End.DT46 behavior
Carmine Scarpitta [Sat, 23 Jul 2022 16:12:23 +0000 (18:12 +0200)]
sharpd: add support for SRv6 End.DT46 behavior

This commit adds the support for SRv6 End.DT46 behavior to SHARPD.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: add SRv6 per-VRF SID to SRv6 details
Carmine Scarpitta [Sat, 23 Jul 2022 10:33:58 +0000 (12:33 +0200)]
bgpd: add SRv6 per-VRF SID to SRv6 details

This commit adds the SRv6 per-VRF SID to the output of "show bgp segment-routing srv6".

Output example:

[...]
bgps:
- name: default
  vpn_policy[AFI_IP].tovpn_sid: none
  vpn_policy[AFI_IP6].tovpn_sid: none
  per-vrf tovpn_sid: none
- name: Vrf10
  vpn_policy[AFI_IP].tovpn_sid: none
  vpn_policy[AFI_IP6].tovpn_sid: none
  per-vrf tovpn_sid: 2001:db8:1:1:100::
[...]

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: add bits length params to the SRv6 details
Carmine Scarpitta [Sat, 23 Jul 2022 10:23:16 +0000 (12:23 +0200)]
bgpd: add bits length params to the SRv6 details

This commit adds "block-length", "node-length", "func-length" and
"arg-length" to the output of "show bgp segment-routing srv6".

Output example:

rose-srv6# show bgp segment-routing srv6
locator_name: loc1
locator_chunks:
- 2001:db8:1:1::/64
  block-length: 40
  node-length: 24
  func-length: 16
  arg-length: 0
[...]

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agobgpd: add support for per-VRF SRv6 SID
Carmine Scarpitta [Sat, 23 Jul 2022 09:49:56 +0000 (11:49 +0200)]
bgpd: add support for per-VRF SRv6 SID

In the current implementation of bgpd, SRv6 SIDs can be configured only
under the address-family. This enables bgpd to leak IPv6 routes using
an SRv6 End.DT6 behavior and IPv4 routes using an SRv6 End.DT4
behavior. It is not possible to leak both IPv6 and IPv4 routes using a
single SRv6 SID.

This commit adds a new CLI command
"sid vpn per-vrf export <sid_idx|auto>" that enables bgpd to leak both
IPv6 and IPv4 routes using a single SRv6 SID (End.DT46 behavior).

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agolib: add block/node/arg len to SRv6 locator JSON
Carmine Scarpitta [Fri, 22 Jul 2022 23:59:06 +0000 (01:59 +0200)]
lib: add block/node/arg len to SRv6 locator JSON

This commit adds the SRv6 locator's block length, node length and
argument length to the output of the command
"show segment-routing srv6 locator json"

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra: add missing bits len to SRv6 locator detail
Carmine Scarpitta [Fri, 22 Jul 2022 23:55:28 +0000 (01:55 +0200)]
zebra: add missing bits len to SRv6 locator detail

This commit adds SRv6 locator's block length, node length and argument
length to the output of the command
"show segment-routing srv6 locator NAME detail [json]".

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra: add block/node/arg len to zebra sr config
Carmine Scarpitta [Fri, 22 Jul 2022 23:50:32 +0000 (01:50 +0200)]
zebra: add block/node/arg len to zebra sr config

This commit adds the SRv6 locator's block length, node length and
argument length to the SRv6 configuration.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra, lib: add support for SRv6 End.DT46 behavior
Carmine Scarpitta [Fri, 22 Jul 2022 23:32:04 +0000 (01:32 +0200)]
zebra, lib: add support for SRv6 End.DT46 behavior

This commit enables zebra to install End.DT46 nexthops into the Linux kernel.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agoinclude: update seg6_local.h to latest kernel
Carmine Scarpitta [Fri, 22 Jul 2022 23:25:44 +0000 (01:25 +0200)]
include: update seg6_local.h to latest kernel

The seg6_local.h header has changed in the kernel. We need a recent
version of the header to support SRv6 End.DT46 behavior.

This commit pulls seg6_local.h header from the Linux kernel.

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agozebra: add new CLI args "block-len" and "node-len"
Carmine Scarpitta [Fri, 22 Jul 2022 22:29:08 +0000 (00:29 +0200)]
zebra: add new CLI args "block-len" and "node-len"

In the current implementation, an SRv6 locator only supports the
following structure:
* node-len = 24
* block-len = prefix-len - 24
* function-len = <configurable>
* argument-len = 0

This commit adds two optional arguments to the locator_prefix CLI
command: "node-len" and "block-len". These arguments allows an user to
configure the block length and node length of a SRv6 locator according
to the following logic:
* the node-len + block-len = prefix-len constraint must always be
satisfied;
* if node-len and block-len are both omitted, they are calculated as in
the current implementation (for backward compatibility reasons)
* if node-len is omitted, its value is computed as
prefix-len - block-len
* if block-len is omitted, its value is computed as
prefix-len - node-len

Signed-off-by: Carmine Scarpitta <carmine.scarpitta@uniroma2.it>
2 years agoMerge pull request #8647 from sworleys/DVNI-Config-Changes
Donatas Abraitis [Tue, 18 Oct 2022 11:17:04 +0000 (14:17 +0300)]
Merge pull request #8647 from sworleys/DVNI-Config-Changes

bgpd: EVPN D-VNI L3 RT Config Enhancements

2 years agoospf6d: adding missing json fields 12146/head
rgirada [Tue, 18 Oct 2022 05:51:18 +0000 (05:51 +0000)]
ospf6d: adding missing json fields

Description:
Active GR count field is missing in json o/p
of 'show ipv6 ospf gr helper' command.

Issue: #12100

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2 years agopimd: Fix v4-over-v6 nexthop handling 12144/head
Sarita Patra [Mon, 17 Oct 2022 21:13:33 +0000 (14:13 -0700)]
pimd: Fix v4-over-v6 nexthop handling

In the current code, if_lookup_by_index()
is called for un-initialized ifindex value.

This issue is introduced after 11098 PR.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2 years agobgpd: Honor default holdtime when triggering session reset for SendHoldTimer 12142/head
Donatas Abraitis [Mon, 17 Oct 2022 10:34:41 +0000 (13:34 +0300)]
bgpd: Honor default holdtime when triggering session reset for SendHoldTimer

If the timer is not explicitly configured for a peer, the default timer
is not taken into account and SendHoldTimer mechanism does not work at all.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2 years agolib,zebra: link-params are not flushed after no enable 12125/head
Louis Scalbert [Fri, 14 Oct 2022 15:57:20 +0000 (17:57 +0200)]
lib,zebra: link-params are not flushed after no enable

Daemons like isisd continue to use the previous link-params after they
are removed from zebra.

For example,
>r0# sh run zebra
> (...)
> interface eth-rt1
>  link-params
>   enable
>   metric 100
>  exit-link-params
> r0# conf
> r0(config)# interface eth-rt1
> r0(config-if)#  link-params
> r0(config-link-params)#   no enable

After "no enable", "sh run zebra" displays no more link-params context.

The "no enable" causes the release of the "link_params" pointer within
the "interface" structure. The zebra function to update daemons with
a ZEBRA_INTERFACE_LINK_PARAMS zapi message is called but the function
returns without doing anything because the "link_params" pointer is
NULL. Therefore, the "link_params" pointers are kept in daemons.

When the zebra "link_params" pointer is NULL:

- Send a zapi link param message that contains no link parameters
  instead of sending no message.
- At reception in daemons, the absence of link parameters causes the
  release of the "link_params" pointer.

Fixes: 16f1b9e ("Update Traffic Engineering Support for OSPFD")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>