-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Loopback Socket #326
base: develop
Are you sure you want to change the base?
Add Loopback Socket #326
Conversation
@@ -445,7 +447,32 @@ impl Cage { | |||
let res = match sockhandle.domain { | |||
AF_UNIX => self.bind_inner_socket_unix(sockhandle, &mut newsockaddr), | |||
AF_INET | AF_INET6 => { | |||
self.bind_inner_socket_inet(sockhandle, &mut newsockaddr, prereserved) | |||
let loopback_addr = u32::from_ne_bytes([127, 0, 0, 7]); |
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.
Why this address only?
self.bind_inner_socket_inet(sockhandle, &mut newsockaddr, prereserved) | ||
let loopback_addr = u32::from_ne_bytes([127, 0, 0, 7]); | ||
match newsockaddr.addr() { | ||
interface::GenIpaddr::V4(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.
V6 has loopback also
@@ -890,6 +917,7 @@ impl Cage { | |||
//by other threads accessing other fields | |||
let sock_tmp = sockfdobj.handle.clone(); | |||
let mut sockhandle = sock_tmp.write(); | |||
|
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.
Extra space
let mut remoteaddr_final = remoteaddr.clone(); | ||
|
||
if remoteaddr.get_family() == AF_INET as u16 { | ||
let loopback_addr = u32::from_ne_bytes([127, 0, 0, 7]); |
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.
Shouldn't define this twice. Use a constant or similar in once place
Description
This PR adds loopback socket (127.0.0.7) for rustposix
Fixes # (issue)
Type of change
How Has This Been Tested?
ipc_tests.rs/ut_lind_ipc_loopback_socket
Checklist: