Date: Wed, 2 Feb 2011 08:24:26 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r218185 - head/sbin/hastd Message-ID: <201102020824.p128OQKv001118@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pjd Date: Wed Feb 2 08:24:26 2011 New Revision: 218185 URL: http://svn.freebsd.org/changeset/base/218185 Log: Be prepared that hp_client or hp_server might be NULL now. MFC after: 1 week Modified: head/sbin/hastd/proto.c Modified: head/sbin/hastd/proto.c ============================================================================== --- head/sbin/hastd/proto.c Wed Feb 2 05:58:51 2011 (r218184) +++ head/sbin/hastd/proto.c Wed Feb 2 08:24:26 2011 (r218185) @@ -83,10 +83,17 @@ proto_common_setup(const char *addr, str 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102020824.p128OQKv001118>