Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aleksey R. (aka EreTIk)
redox
Commits
6fa887ff
Commit
6fa887ff
authored
Feb 07, 2017
by
Jeremy Soller
Browse files
Update to fix network stack
parent
9de8be3c
Changes
4
Hide whitespace changes
Inline
Side-by-side
schemes/ethernetd/src/main.rs
View file @
6fa887ff
...
...
@@ -88,16 +88,18 @@ fn daemon(network_fd: usize, socket_fd: usize) {
fn
main
()
{
match
syscall
::
open
(
"network:"
,
syscall
::
O_RDWR
|
syscall
::
O_NONBLOCK
)
{
Ok
(
network_fd
)
=>
match
syscall
::
open
(
":ethernet"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
{
Ok
(
socket_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
daemon
(
network_fd
,
socket_fd
);
Ok
(
network_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
match
syscall
::
open
(
":ethernet"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
{
Ok
(
socket_fd
)
=>
{
daemon
(
network_fd
,
socket_fd
);
},
Err
(
err
)
=>
{
println!
(
"ethernetd: failed to create ethernet scheme: {}"
,
err
);
process
::
exit
(
1
);
}
}
},
Err
(
err
)
=>
{
println!
(
"ethernetd: failed to create ethernet scheme: {}"
,
err
);
process
::
exit
(
1
);
}
},
Err
(
err
)
=>
{
...
...
schemes/ipd/src/main.rs
View file @
6fa887ff
...
...
@@ -314,16 +314,18 @@ fn daemon(arp_fd: usize, ip_fd: usize, scheme_fd: usize) {
fn
main
()
{
match
syscall
::
open
(
"ethernet:806"
,
syscall
::
O_RDWR
|
syscall
::
O_NONBLOCK
)
{
Ok
(
arp_fd
)
=>
match
syscall
::
open
(
"ethernet:800"
,
syscall
::
O_RDWR
|
syscall
::
O_NONBLOCK
)
{
Ok
(
ip_fd
)
=>
match
syscall
::
open
(
":ip"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
daemon
(
arp_fd
,
ip_fd
,
scheme_fd
);
Ok
(
ip_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
match
syscall
::
open
(
":ip"
,
syscall
::
O_RDWR
|
syscall
::
O_CREAT
|
syscall
::
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
daemon
(
arp_fd
,
ip_fd
,
scheme_fd
);
},
Err
(
err
)
=>
{
println!
(
"ipd: failed to create ip scheme: {}"
,
err
);
process
::
exit
(
1
);
}
}
},
Err
(
err
)
=>
{
println!
(
"ipd: failed to create ip scheme: {}"
,
err
);
process
::
exit
(
1
);
}
},
Err
(
err
)
=>
{
...
...
schemes/tcpd/src/main.rs
View file @
6fa887ff
...
...
@@ -809,16 +809,18 @@ fn daemon(tcp_fd: usize, scheme_fd: usize) {
fn
main
()
{
match
syscall
::
open
(
"ip:6"
,
O_RDWR
|
O_NONBLOCK
)
{
Ok
(
tcp_fd
)
=>
match
syscall
::
open
(
":tcp"
,
O_RDWR
|
O_CREAT
|
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
daemon
(
tcp_fd
,
scheme_fd
);
Ok
(
tcp_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
match
syscall
::
open
(
":tcp"
,
O_RDWR
|
O_CREAT
|
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
daemon
(
tcp_fd
,
scheme_fd
);
},
Err
(
err
)
=>
{
println!
(
"tcpd: failed to create tcp scheme: {}"
,
err
);
process
::
exit
(
1
);
}
}
},
Err
(
err
)
=>
{
println!
(
"tcpd: failed to create tcp scheme: {}"
,
err
);
process
::
exit
(
1
);
}
},
Err
(
err
)
=>
{
...
...
schemes/udpd/src/main.rs
View file @
6fa887ff
...
...
@@ -476,16 +476,18 @@ fn daemon(udp_fd: usize, scheme_fd: usize) {
fn
main
()
{
match
syscall
::
open
(
"ip:11"
,
O_RDWR
|
O_NONBLOCK
)
{
Ok
(
udp_fd
)
=>
match
syscall
::
open
(
":udp"
,
O_RDWR
|
O_CREAT
|
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
daemon
(
udp_fd
,
scheme_fd
);
Ok
(
udp_fd
)
=>
{
// Daemonize
if
unsafe
{
syscall
::
clone
(
0
)
.unwrap
()
}
==
0
{
match
syscall
::
open
(
":udp"
,
O_RDWR
|
O_CREAT
|
O_NONBLOCK
)
{
Ok
(
scheme_fd
)
=>
{
daemon
(
udp_fd
,
scheme_fd
);
},
Err
(
err
)
=>
{
println!
(
"udpd: failed to create udp scheme: {}"
,
err
);
process
::
exit
(
1
);
}
}
},
Err
(
err
)
=>
{
println!
(
"udpd: failed to create udp scheme: {}"
,
err
);
process
::
exit
(
1
);
}
},
Err
(
err
)
=>
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment