Mercurial > dropbear
comparison netio.c @ 1309:3b624ad2dc5e
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 | 57d09741d46d |
children | 2c9dac2d6707 78b7e0634117 |
comparison
equal
deleted
inserted
replaced
1308:8678e2cc1e53 | 1309:3b624ad2dc5e |
---|---|
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); |