From c5bd1fa8f1a4f2b09dde25a7e145d2bd99692e06 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Thu, 7 Mar 2013 18:08:50 +0100 Subject: [PATCH] make sendto() and accept() interfaces conform to POSIX, doesn't change anything as addrlen is unused anyway --- sys/net/destiny/socket.c | 4 ++-- sys/net/destiny/socket.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/net/destiny/socket.c b/sys/net/destiny/socket.c index d7c4fc6006..69d01796c2 100644 --- a/sys/net/destiny/socket.c +++ b/sys/net/destiny/socket.c @@ -888,7 +888,7 @@ int32_t recvfrom(int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, u } } -int32_t sendto(int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen) +int32_t sendto(int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen) { if (isUDPSocket(s) && (getSocket(s)->socket_values.foreign_address.sin6_port == 0)) { @@ -1176,7 +1176,7 @@ int handle_new_tcp_connection(socket_internal_t *current_queued_int_socket, sock return current_queued_int_socket->socket_id; } -int accept(int s, sockaddr6_t *addr, uint32_t addrlen) +int accept(int s, sockaddr6_t *addr, uint32_t *addrlen) { socket_internal_t *server_socket = getSocket(s); if (isTCPSocket(s) && (server_socket->socket_values.tcp_control.state == LISTEN)) diff --git a/sys/net/destiny/socket.h b/sys/net/destiny/socket.h index d43afcb8c2..7737ae414e 100644 --- a/sys/net/destiny/socket.h +++ b/sys/net/destiny/socket.h @@ -194,13 +194,13 @@ int connect(int socket, sockaddr6_t *addr, uint32_t addrlen); socket_internal_t *getWaitingConnectionSocket(int socket, ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header); void close_socket(socket_internal_t *current_socket); int32_t recvfrom( int s, void *buf, uint32_t len, int flags, sockaddr6_t *from, uint32_t *fromlen ); -int32_t sendto( int s, void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen); +int32_t sendto( int s, const void *msg, uint32_t len, int flags, sockaddr6_t *to, uint32_t tolen); int32_t send(int s, void *msg, uint32_t len, int flags); int recv(int s, void *buf, uint32_t len, int flags); int close(int s); int bind(int s, sockaddr6_t *name, int namelen); int listen(int s, int backlog); -int accept(int s, sockaddr6_t *addr, uint32_t addrlen); +int accept(int s, sockaddr6_t *addr, uint32_t *addrlen); void socket_init(void); socket_internal_t *get_udp_socket(ipv6_hdr_t *ipv6_header, udp_hdr_t *udp_header); socket_internal_t *get_tcp_socket(ipv6_hdr_t *ipv6_header, tcp_hdr_t *tcp_header);