-
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
More connection cleanup #18195
base: master
Are you sure you want to change the base?
More connection cleanup #18195
Conversation
Currently the incoming and outgoing connections mix up their logs and there is absolutely no way to tell which way is being talked about when both are operating. Signed-off-by: Donald Sharp <[email protected]>
The bgp_accept code calls the different connections connection and connection1. Frankly this is confusing and hard to keep track of what we are talking about since they are poorly named. Let's start naming these variables things that make logical sense. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
In bgp_accept, the newly created doppelganger is accepting a connection and setting it up to work properly. For this incoming connection let's call it incoming as well. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
bgp_accept looks up the peer data structure. The found one represents the peer data structure that is created when configuration is created. This connection is being called connection1. Let's rename this to connection to reduce some confusion. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
The dynamic peer being created is being called peer1 let's call it dynamic_peer instead. This will make what is being done clearer for future developers. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
Currently the code in bgp_accept is calling the doppelganger `peer`. This is confusing with peer and peer1. Let's just call it doppelganger. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
The bgp_accept function was calling the existing peer data structure peer1 for some reason. Let's just call it peer instead of peer1. Author's Note: I am changing the bgp_accept function in this manner because I find it incredibly confusing remembering what is what direction and all my other attempts at getting this straight has caused real problems. So I am resorting to doing really small transformational changes at a time. Signed-off-by: Donald Sharp <[email protected]>
The peer is going to eventually have a incoming and outgoing connection. Let's send the data based upon the connection not the peer. Signed-off-by: Donald Sharp <[email protected]>
Again instead of making the keepalives be peer based use the connection to make it happen. Signed-off-by: Donald Sharp <[email protected]>
61d59c9
to
6fe0eb3
Compare
UNKNOWN, | ||
CONNECTION_INCOMING, | ||
CONNECTION_OUTGOING, | ||
ESTABLISHED, |
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.
established and direction does not sound very common or how do we need to interpret it?
return "Established"; | ||
} | ||
|
||
assert(!"DEV Escape: Expected switch totake care of this state"); |
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.
typo totake?
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.
looks good, just waiting on comments from @ton31337
See individual commits. But the gist of these commits is to further cleanup usages of the connection instead of the peer. Additionally clean up bgp_accept to have a better naming convention.