diff options
author | pjd <pjd@FreeBSD.org> | 2011-02-02 08:24:26 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2011-02-02 08:24:26 +0000 |
commit | 3d021845fb3da3ecb328f8817a723c879122b386 (patch) | |
tree | ecf6154584152699c68932fa76e684f88f834f80 /sbin | |
parent | 696e30ffcc62f7282bba230ac5aecfd0bfcb46eb (diff) | |
download | FreeBSD-src-3d021845fb3da3ecb328f8817a723c879122b386.zip FreeBSD-src-3d021845fb3da3ecb328f8817a723c879122b386.tar.gz |
Be prepared that hp_client or hp_server might be NULL now.
MFC after: 1 week
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/hastd/proto.c | 15 |
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 |