summaryrefslogtreecommitdiff
path: root/socket.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2023-10-27 22:17:24 +0200
committerAnton Kling <anton@kling.gg>2023-10-30 21:49:48 +0100
commitd50d18c9da3a125f0196bec89802dec1c5b0b800 (patch)
treed9a4e74906c5ab51708d148ad3728cc155a9893d /socket.c
parent4f9ed7087cb58683d9423ab771ad76b31dac5514 (diff)
Kernel/LibC/Networking: Be able to send UDP messages
Now it can send UDP messages to a specific IP address and libc has enough to create a basic UDP ECHO server, that is kinda cool.
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index 4ef4b3a..0519c65 100644
--- a/socket.c
+++ b/socket.c
@@ -111,6 +111,7 @@ int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
us->path = s->path;
us->s = s;
+ s->child = us;
devfs_add_file(us->path, NULL, NULL, NULL, 1, 1, FS_TYPE_UNIX_SOCKET);
return 0;
}
@@ -127,6 +128,7 @@ int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen) {
inet->address = in->sin_addr.s_addr;
inet->port = in->sin_port;
inet->s = s;
+ s->child = inet;
return 0;
}
return 0;