Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bgp connect refactor #17810

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

donaldsharp
Copy link
Member

No description provided.

Let's make it so.

Signed-off-by: Donald Sharp <[email protected]>
su_local and su_remote in the peer can change based upon
if we are initiating the remote connection or receiving it.
As such we need to treat it as a property of the connection.

Signed-off-by: Donald Sharp <[email protected]>
Currently bgp is repeatedly grabbing peer connection information.
This is a bit overkill.  There are two situations:

a) Opening a connection to the peer
   In this case, we know the remote port/address a priori and can get
   the local information by just asking the OS.
b) Peer opening a connection to us.
   In this case, we know the local port/address a priori and can get
   the remote information by just asking the OS.

Modify the code to just grab this data at the appropriate time.

Signed-off-by: Donald Sharp <[email protected]>
@donaldsharp donaldsharp force-pushed the bgp_connect_refactor branch from ad99350 to 65573cb Compare January 9, 2025 18:18
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

@@ -419,6 +419,7 @@ static void bgp_accept(struct event *thread)

/* Accept client connection. */
bgp_sock = sockunion_accept(accept_sock, &su);
zlog_debug("DBS: accepted: %pSUp", &su);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftovers?

@@ -1350,8 +1353,8 @@ struct peer {
char *update_if;
union sockunion *update_source;

union sockunion *su_local; /* Sockunion of local address. */
union sockunion *su_remote; /* Sockunion of remote address. */
// union sockunion *su_local; /* Sockunion of local address. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we drop them actually?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants