-
Notifications
You must be signed in to change notification settings - Fork 129
[inetstack] Bug Fix: Simultaneous close misses FIN resend #1538
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
base: dev
Are you sure you want to change the base?
Conversation
libos = catnap
|
libos = catpowder
|
libos = catnip
|
Sender::send_ack(cb, layer3_endpoint); | ||
}, | ||
state => warn!("Ignoring data received after FIN (in state {:?}).", state), | ||
if data.len() > 0 { |
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.
We should return early by flipping the condition. This will reduce the level of nesting in this function as well.
}; | ||
// Store whether the packet has data here because processing it will consume the DemiBuffer. | ||
let has_data: bool = data.len() > 0; | ||
Self::process_data_if_any(cb, layer3_endpoint, data, seg_start, seg_end, seg_len)?; |
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 this call be avoided by checking has_data
above?
layer3_endpoint: &mut SharedLayer3Endpoint, | ||
now: Instant, | ||
) -> Result<(), Fail> { | ||
// Is this a FIN packet? |
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.
This comment can be removed as the next line is unambiguous.
|
||
pub fn get_receive_window_size(&self) -> u32 { | ||
let bytes_unread: u32 = (self.receive_next_seq_no - self.reader_next_seq_no).into(); | ||
// The window should be less than 1GB or 64KB without scaling. |
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.
It would be good to not assume these absolute sizes in the comments. These are susceptible to going stale in case the values of constants change in future.
// This inserts the segment and wakes a waiting pop coroutine. | ||
self.pop_queue.push(temp.1); | ||
} | ||
} else { |
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.
This conditional can be inverted to reduce nesting. The indentation level is pretty high in this function. Along with that, it can be broken down into smaller functions if the indentation/nesting still remains high.
This PR closes #1529 and #1537