Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2043234

Summary: Missing validation when creating several BGPPeers with the same peerAddress
Product: OpenShift Container Platform Reporter: Jose Castillo Lema <jlema>
Component: NetworkingAssignee: Mohamed Mahmoud <mmahmoud>
Networking sub component: Metal LB QA Contact: Arti Sood <asood>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: low CC: dblack, jlema, murali
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:41:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jose Castillo Lema 2022-01-20 20:45:25 UTC
Description of problem:
In FRR is not possible (as far as I know) to have the same neighbor defined twice (or more) with different ASN. As an example, if you try:
  neighbor 192.168.216.10 remote-as 65000
  neighbor 192.168.216.10 remote-as 65001
only one of the entries will get applied (and shown if running show running-config), not both.

So, MetalLB should not allow to create two BGPPeer objects with the same peerAddress.
In case this is a limitation specific to FRR (and not applicable to go-bgp), upon trying to create the secondary bgpPeer object the user should receive some kind of error like the following:
The BGPPeer "peer-65002" is invalid: spec.PeerAddress: Invalid value: 0xfdeb: Multiple equal peerAddress definitions not supported in FRR mode, ...

Version-Release number of selected component (if applicable):
Client Version: 4.10.0-0.nightly-2022-01-10-101431
Server Version: 4.10.0-0.nightly-2022-01-10-101431
metallb-operator.4.10.0-202201180823

How reproducible:
100%

Steps to Reproduce:
1. Create the first BGPPeer object:
    apiVersion: metallb.io/v1beta1
    kind: BGPPeer
    metadata:
      name: peer-65001
      namespace: metallb-system
    spec:
      peerAddress: 192.168.216.1
      peerASN: 65001
      myASN: 65000
2. Create the second BGPPeer object:
    apiVersion: metallb.io/v1beta1
    kind: BGPPeer
    metadata:
      name: peer-65002
      namespace: metallb-system
    spec:
      peerAddress: 192.168.216.1
      peerASN: 65002
      myASN: 65000

Actual results:
 - Both BGPPeers are created, however only one of them is correctly applied in the speaker configuration

Expected results:
 - The second BGPPeer creation should fail. In case this is a limitation specific to FRR (and not applicable to go-bgp) the user should receive some kind of error like the following:
The BGPPeer "peer-65002" is invalid: spec.PeerAddress: Invalid value: 0xfdeb: Multiple equal peerAddress definitions not supported in FRR mode, ...

Comment 5 errata-xmlrpc 2022-03-10 16:41:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.10.3 security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0056