diff options
Diffstat (limited to 'src/user/app/netstack')
-rw-r--r-- | src/user/app/netstack/fs.c | 3 | ||||
-rw-r--r-- | src/user/app/netstack/netstack.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/user/app/netstack/fs.c b/src/user/app/netstack/fs.c index d8faadf..ad6c23c 100644 --- a/src/user/app/netstack/fs.c +++ b/src/user/app/netstack/fs.c @@ -144,7 +144,8 @@ static void fs_open(handle_t reqh, char *path, int flags) { } /* everything below ends up sending packets */ - if (flags & OPEN_RO) respond(NULL, -EACCES); + if (!OPEN_WRITEABLE(flags)) + respond(NULL, -EACCES); char *save; const char *verb, *proto, *port_s; diff --git a/src/user/app/netstack/netstack.c b/src/user/app/netstack/netstack.c index cc5247b..c0934fd 100644 --- a/src/user/app/netstack/netstack.c +++ b/src/user/app/netstack/netstack.c @@ -1,5 +1,6 @@ #include "proto.h" #include "util.h" +#include <camellia/flags.h> #include <camellia/syscalls.h> #include <stdbool.h> #include <stddef.h> @@ -33,7 +34,7 @@ int main(int argc, char **argv) { eprintf("usage: netstack iface ip gateway"); return 1; } - state.raw_h = _syscall_open(argv[1], strlen(argv[1]), 0); + state.raw_h = _syscall_open(argv[1], strlen(argv[1]), OPEN_RW); if (state.raw_h < 0) { eprintf("couldn't open %s", argv[1]); return 1; |