comparison netio.c @ 1298:251c5f7a6e96

make sure socket is of the right domain
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Jun 2016 20:38:38 +0800
parents 750ec4ec4cbe
children 2c9dac2d6707
comparison
equal deleted inserted replaced
1297:5abbecdecba4 1298:251c5f7a6e96
59 59
60 for (r = c->res_iter; r; r = r->ai_next) 60 for (r = c->res_iter; r; r = r->ai_next)
61 { 61 {
62 dropbear_assert(c->sock == -1); 62 dropbear_assert(c->sock == -1);
63 63
64 c->sock = socket(c->res_iter->ai_family, c->res_iter->ai_socktype, c->res_iter->ai_protocol); 64 c->sock = socket(r->ai_family, r->ai_socktype, r->ai_protocol);
65 if (c->sock < 0) { 65 if (c->sock < 0) {
66 continue; 66 continue;
67 } 67 }
68 68
69 ses.maxfd = MAX(ses.maxfd, c->sock); 69 ses.maxfd = MAX(ses.maxfd, c->sock);