From: Ben Gras Date: Thu, 1 Sep 2005 15:24:29 +0000 (+0000) Subject: Made socket() accept an udp or tcp protocol number X-Git-Tag: v3.1.0~206 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/zones/static/sign.html?a=commitdiff_plain;h=9bc5da42769491aa7be156ea12db78b426f8740e;p=minix.git Made socket() accept an udp or tcp protocol number --- 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);