From 9bc5da42769491aa7be156ea12db78b426f8740e Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Thu, 1 Sep 2005 15:24:29 +0000 Subject: [PATCH] Made socket() accept an udp or tcp protocol number --- lib/ip/socket.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ip/socket.c b/lib/ip/socket.c index 70a812e1e..7900ce341 100644 --- a/lib/ip/socket.c +++ b/lib/ip/socket.c @@ -5,6 +5,7 @@ #include #include +#include #define DEBUG 0 @@ -42,7 +43,7 @@ int socket(int domain, int type, int protocol) static int _tcp_socket(int protocol) { int fd; - if (protocol != 0) + if (protocol != 0 && protocol != IPPROTO_TCP) { #if DEBUG fprintf(stderr, "socket(tcp): bad protocol %d\n", protocol); @@ -58,7 +59,7 @@ static int _udp_socket(int protocol) { int fd; - if (protocol != 0) + if (protocol != 0 && protocol != IPPROTO_UDP) { #if DEBUG fprintf(stderr, "socket(udp): bad protocol %d\n", protocol); -- 2.44.0