BUG/MINOR: config: check the proper pointer to report unknown protocol

Check the protocol pointer and not the socket to report an unknown family
in servers or peers. This can never happen anyway, it's just to be completely
clean.
This commit is contained in:
Willy Tarreau 2012-09-24 22:47:39 +02:00
parent e92693af26
commit 173e7fbd94

View File

@ -1309,7 +1309,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm)
newpeer->data = &raw_sock;
newpeer->sock_init_arg = NULL;
if (!sk) {
if (!newpeer->proto) {
Alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
file, linenum, newpeer->addr.ss_family, args[2]);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3951,7 +3951,7 @@ stats_error_parsing:
newsrv->proto = protocol_by_family(newsrv->addr.ss_family);
newsrv->data = &raw_sock;
if (!sk) {
if (!newsrv->proto) {
Alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
file, linenum, newsrv->addr.ss_family, args[2]);
err_code |= ERR_ALERT | ERR_FATAL;