-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Bgp connect refactor #17810
Conversation
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]>
ad99350
to
65573cb
Compare
There was a problem hiding this 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); |
There was a problem hiding this comment.
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. */ |
There was a problem hiding this comment.
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?
No description provided.