Revision 9c89560e sysdep/unix/io.c
sysdep/unix/io.c | ||
---|---|---|
1305 | 1305 |
log(L_ERR "SOCK: Incoming connection: %s%#m", t->err); |
1306 | 1306 |
|
1307 | 1307 |
/* FIXME: handle it better in rfree() */ |
1308 |
close(t->fd);
|
|
1308 |
close(t->fd); |
|
1309 | 1309 |
t->fd = -1; |
1310 | 1310 |
rfree(t); |
1311 | 1311 |
return 1; |
... | ... | |
1348 | 1348 |
bind_addr = s->saddr; |
1349 | 1349 |
do_bind = bind_port || ipa_nonzero(bind_addr); |
1350 | 1350 |
break; |
1351 |
|
|
1351 |
|
|
1352 | 1352 |
case SK_UDP: |
1353 | 1353 |
fd = socket(af, SOCK_DGRAM, IPPROTO_UDP); |
1354 | 1354 |
bind_port = s->sport; |
... | ... | |
1399 | 1399 |
} |
1400 | 1400 |
#endif |
1401 | 1401 |
} |
1402 |
#ifdef IP_PORTRANGE |
|
1403 |
else if (s->flags & SKF_HIGH_PORT) |
|
1404 |
{ |
|
1405 |
int range = IP_PORTRANGE_HIGH; |
|
1406 |
if (setsockopt(fd, IPPROTO_IP, IP_PORTRANGE, &range, sizeof(range)) < 0) |
|
1407 |
log(L_WARN "Socket error: %s%#m", "IP_PORTRANGE"); |
|
1408 |
} |
|
1409 |
#endif |
|
1402 | 1410 |
|
1403 | 1411 |
sockaddr_fill(&sa, af, bind_addr, s->iface, bind_port); |
1404 | 1412 |
if (bind(fd, &sa.sa, SA_LEN(sa)) < 0) |
... | ... | |
1661 | 1669 |
|
1662 | 1670 |
redo: |
1663 | 1671 |
rv = select(s->fd+1, &rd, &wr, NULL, &timo); |
1664 |
|
|
1672 |
|
|
1665 | 1673 |
if ((rv < 0) && (errno == EINTR || errno == EAGAIN)) |
1666 | 1674 |
goto redo; |
1667 | 1675 |
|
... | ... | |
2026 | 2034 |
die("I found another BIRD running."); |
2027 | 2035 |
close(fd); |
2028 | 2036 |
} |
2029 |
|
|
2030 |
|
Also available in: Unified diff