From de0a39089cb8e12bf467c05be8471c37d4220f02 Mon Sep 17 00:00:00 2001 From: Michael Theall Date: Thu, 21 Jan 2016 17:12:58 -0600 Subject: [PATCH] replace 6, 17 with IPPROTO_TCP, IPPROTO_UDP respectively --- libctru/source/services/soc/soc_socket.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libctru/source/services/soc/soc_socket.c b/libctru/source/services/soc/soc_socket.c index 832aeca..9ee007f 100644 --- a/libctru/source/services/soc/soc_socket.c +++ b/libctru/source/services/soc/soc_socket.c @@ -1,5 +1,6 @@ #include "soc_common.h" #include +#include #include #include #include <3ds/ipc.h> @@ -13,10 +14,14 @@ int socket(int domain, int type, int protocol) // The protocol on the 3DS *must* be 0 to work // To that end, when appropriate, we will make the change for the user - if (domain == AF_INET && type == SOCK_STREAM && protocol == 6) { + if (domain == AF_INET + && type == SOCK_STREAM + && protocol == IPPROTO_TCP) { protocol = 0; // TCP is the only option, so 0 will work as expected } - if (domain == AF_INET && type == SOCK_DGRAM && protocol == 17) { + if (domain == AF_INET + && type == SOCK_DGRAM + && protocol == IPPROTO_UDP) { protocol = 0; // UDP is the only option, so 0 will work as expected }