repositories
/
deb_libnfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0268794
)
Dont allow a tcp _connect to a UDP context
author
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 08:32:06 +0000
(18:32 +1000)
committer
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Sun, 26 Jun 2011 08:32:06 +0000
(18:32 +1000)
lib/socket.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/socket.c
b/lib/socket.c
index ffccd27f39249b44980de36df901579a605c6cc6..a0ededa61a625f7cc463b1a2d4da8cca78dcf1de 100644
(file)
--- 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) {