From: Ronnie Sahlberg Date: Sun, 26 Jun 2011 08:32:06 +0000 (+1000) Subject: Dont allow a tcp _connect to a UDP context X-Git-Tag: upstream/1.9.6^2~375 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=070287e5162654027f63525c66de7a6598514222;p=deb_libnfs.git Dont allow a tcp _connect to a UDP context --- diff --git a/lib/socket.c b/lib/socket.c index ffccd27..a0ededa 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -287,6 +287,11 @@ int rpc_connect_async(struct rpc_context *rpc, const char *server, int port, rpc return -1; } + if (rpc->is_udp != 0) { + rpc_set_error(rpc, "Trying to connect on UDP socket"); + return -1; + } + sin->sin_family = AF_INET; sin->sin_port = htons(port); if (inet_pton(AF_INET, server, &sin->sin_addr) != 1) {