From eea2deaad04644b7f677033f3f8e3cbb0cc9c22f Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 30 Aug 2010 23:16:45 +0000 Subject: [PATCH] When someone gives NULL as data, assume this is because he want to declare connection side only. MFC after: 2 weeks Obtained from: Wheel Systems Sp. z o.o. http://www.wheelsystems.com --- sbin/hastd/proto_socketpair.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sbin/hastd/proto_socketpair.c b/sbin/hastd/proto_socketpair.c index 0d040f39454..c0b41a46da3 100644 --- a/sbin/hastd/proto_socketpair.c +++ b/sbin/hastd/proto_socketpair.c @@ -140,6 +140,10 @@ sp_send(void *ctx, const unsigned char *data, size_t size) abort(); } + /* Someone is just trying to decide about side. */ + if (data == NULL) + return (0); + return (proto_common_send(fd, data, size)); } @@ -174,6 +178,10 @@ sp_recv(void *ctx, unsigned char *data, size_t size) abort(); } + /* Someone is just trying to decide about side. */ + if (data == NULL) + return (0); + return (proto_common_recv(fd, data, size)); }