this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add dummy networking ioctls (#293)

+20 -1
+1
src/kernel/emulation/linux/CMakeLists.txt
··· 198 198 ioctl/ioctl.c 199 199 ioctl/termios.c 200 200 ioctl/filio.c 201 + ioctl/socket.c 201 202 ext/sysinfo.c 202 203 ext/uname.c 203 204 ext/epoll_create.c
+3
src/kernel/emulation/linux/ioctl/ioctl.c
··· 5 5 #include <stdbool.h> 6 6 #include "termios.h" 7 7 #include "filio.h" 8 + #include "termios.h" 9 + #include "socket.h" 8 10 9 11 #define IOCTL_STEP(x) { int state, retval; state = (x); \ 10 12 if (state == IOCTL_HANDLED) return retval; } ··· 13 15 long sys_ioctl(int fd, int cmd, void* arg) 14 16 { 15 17 IOCTL_STEP(handle_filio(fd, cmd, arg, &retval)); 18 + IOCTL_STEP(handle_socket(fd, cmd, arg, &retval)); 16 19 IOCTL_STEP(handle_termios(fd, cmd, arg, &retval)); 17 20 18 21 run_ioctl:
+16 -1
src/kernel/emulation/linux/ioctl/socket.c
··· 1 1 #include "socket.h" 2 2 #include <sys/errno.h> 3 + #include <sys/socket.h> 4 + #include <ifaddrs.h> 5 + #include <net/if.h> 6 + #include <netinet/in.h> 7 + #include <sys/sockio.h> 8 + #include <netinet6/in6_var.h> 3 9 4 10 int handle_socket(int fd, unsigned int cmd, void* arg, int* retval) 5 11 { 6 - // BEWARE: This function is not yet wired into the logic and the build 12 + switch (cmd) 13 + { 14 + // TODO: This has to be implemented for container with separate networking 15 + case SIOCGIFFLAGS: 16 + case SIOCSIFFLAGS: 17 + case SIOCAIFADDR: // set IPv4 address 18 + case SIOCAIFADDR_IN6: // set IPv6 address 19 + *retval = -ENOTSUP; 20 + return IOCTL_HANDLED; 21 + } 7 22 return IOCTL_PASS; 8 23 } 9 24