-
Notifications
You must be signed in to change notification settings - Fork 116
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
[inetstack] Fail to Close Bound and Unbound Sockets #517
Conversation
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.
LGTM
let cause: String = format!("cannot close a socket that is closing (qd={:?})", qd); | ||
error!("do_close(): {}", &cause); | ||
return Err(Fail::new(libc::ENOTSUP, &cause)); | ||
}, | ||
} | ||
}, | ||
_ => return Err(Fail::new(libc::EBADF, "bad queue descriptor")), | ||
}; | ||
inner.addresses.remove(&SocketId::Passive(addr)); |
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 you add a TODO comment to remove active sockets from the addresses table when the close completes?
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.
Sure.
@@ -459,7 +459,7 @@ fn tcp_bad_listen() { | |||
Err(e) if e.errno == libc::EINVAL => (), | |||
_ => panic!("invalid call to listen() should fail with EINVAL"), | |||
}; | |||
safe_close_passive(&mut libos, sockqd); | |||
safe_close_active(&mut libos, sockqd); |
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.
Inside the safe_close_active function, the error still says passive socket.
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.
Fixed.
72f1872
to
8e1d719
Compare
Description
safe_close_passive
#512Summary of Changes
close()
to succeed when closing bound and unbound socketssafe_close_active()
to correctly close active sockets.