summaryrefslogtreecommitdiffstats
path: root/sbin/hastd/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/hastd/proto.c')
-rw-r--r--sbin/hastd/proto.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sbin/hastd/proto.c b/sbin/hastd/proto.c
index a00a8ec5..6c8382f 100644
--- a/sbin/hastd/proto.c
+++ b/sbin/hastd/proto.c
@@ -83,10 +83,17 @@ proto_common_setup(const char *addr, struct proto_conn **connp, int side)
return (-1);
TAILQ_FOREACH(proto, &protos, hp_next) {
- if (side == PROTO_SIDE_CLIENT)
- ret = proto->hp_client(addr, &ctx);
- else /* if (side == PROTO_SIDE_SERVER_LISTEN) */
- ret = proto->hp_server(addr, &ctx);
+ if (side == PROTO_SIDE_CLIENT) {
+ if (proto->hp_client == NULL)
+ ret = -1;
+ else
+ ret = proto->hp_client(addr, &ctx);
+ } else /* if (side == PROTO_SIDE_SERVER_LISTEN) */ {
+ if (proto->hp_server == NULL)
+ ret = -1;
+ else
+ ret = proto->hp_server(addr, &ctx);
+ }
/*
* ret == 0 - success
* ret == -1 - addr is not for this protocol
OpenPOWER on IntegriCloud