Skip to content

Commit

Permalink
bgpd: BGP neighbor password change doesn't take effect with a a parti…
Browse files Browse the repository at this point in the history
…cular config on reboot

Description: when vrf add is received, add Vrf-name to the interface database. This is needed while binding the VRF interface to the BGP socket.
In this case, the global bgp config containing vrf is received before zebra sends vrf add message to BGP. When we receive the global bgp vrf message
first, vrf interface is not present in the interface database of BGP. So, while creating the global bgp socket, interface bind to the vrf interface fails.
Also, when setting the password on the bgp socket, first we should apply the password on the socket and then, reset the session or send update to peer.

Problem Description/Summary :
changing the neighbor password resets the session immediately but it doesn't use the password. It continues to operate without password.

Managed to recreate the issue with below reduced config.

Setup:
Sonic1------Sonic2

Test Steps:
1. Configure eBGP session between Sonic-1 and Sonic2 in default vrf using Peer-group.
2. Create a dummy non-default vrf BGP instance on Sonic1 device.
3. Save and reload Sonic1 device.
4. Once the device is up, try to configure 'password <string>' on Sonic1 BGP neighbor alone.
5. The eBGP session should go down and must not come up until matching password is configured on Sonic2 device. But it comes up.

Expected Behavior :
The eBGP session should go down and must not come up until matching password is configured on Sonic2 device.

Signed-off-by: sudhanshukumar22 <sudhanshu.kumar@broadcom.com>
  • Loading branch information
sudhanshukumar22 committed Apr 5, 2021
1 parent 283981e commit e7d89cc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,15 @@ static int bgp_vrf_new(struct vrf *vrf)
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("VRF Created: %s(%u)", vrf->name, vrf->vrf_id);

struct interface *ifp;

ifp = if_get_by_name(vrf->name, vrf->vrf_id);
if (ifp) {
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("VRF interface Created: %s(%u) ifindex %d",
ifp->name, ifp->vrf_id, ifp->ifindex);
}

return 0;
}

Expand All @@ -281,6 +290,9 @@ static int bgp_vrf_delete(struct vrf *vrf)
if (BGP_DEBUG(zebra, ZEBRA))
zlog_debug("VRF Deletion: %s(%u)", vrf->name, vrf->vrf_id);

/* No need to delete vrf here as it will be deleted when BGP client
receives ZEBRA_VRF_DELETE message from zebra */

return 0;
}

Expand Down

0 comments on commit e7d89cc

Please sign in to comment.