mirror of
https://repo.or.cz/socat.git
synced 2025-07-15 15:43:24 +00:00
Preferred IP version sorts getaddrionf() results
This commit is contained in:
parent
2d282f5608
commit
277f0d755d
16 changed files with 331 additions and 146 deletions
|
@ -74,7 +74,7 @@ int xioopen_rawip_sendto(int argc, const char *argv[], struct opt *opts,
|
|||
return STAT_NORETRY;
|
||||
}
|
||||
|
||||
xioinit_ip(&xxfd->stream, &pf);
|
||||
xioinit_ip(&pf, xioparms.preferred_ip);
|
||||
if ((result = _xioopen_rawip_sendto(argv[1], argv[2], opts, xioflags, xxfd,
|
||||
groups, &pf)) != STAT_OK) {
|
||||
return result;
|
||||
|
@ -165,7 +165,7 @@ int xioopen_rawip_datagram(int argc, const char *argv[], struct opt *opts,
|
|||
return STAT_NORETRY;
|
||||
}
|
||||
|
||||
xioinit_ip(xfd, &pf);
|
||||
xioinit_ip(&pf, xioparms.preferred_ip);
|
||||
if ((result =
|
||||
_xioopen_rawip_sendto(argv[1], argv[2], opts, xioflags, xxfd,
|
||||
groups, &pf)) != STAT_OK) {
|
||||
|
@ -220,7 +220,7 @@ int xioopen_rawip_recvfrom(int argc, const char *argv[], struct opt *opts,
|
|||
return STAT_NORETRY;
|
||||
}
|
||||
|
||||
xioinit_ip(&xfd->stream, &pf);
|
||||
xioinit_ip(&pf, xioparms.default_ip);
|
||||
if ((ipproto = strtoul(protname, &garbage, 0)) >= 256) {
|
||||
Error2("xioopen_rawip_recvfrom(\"%s\",,): protocol number exceeds 255 (%u)",
|
||||
protname, ipproto);
|
||||
|
@ -284,7 +284,7 @@ int xioopen_rawip_recv(int argc, const char *argv[], struct opt *opts,
|
|||
return STAT_NORETRY;
|
||||
}
|
||||
|
||||
xioinit_ip(&xfd->stream, &pf);
|
||||
xioinit_ip(&pf, xioparms.default_ip);
|
||||
if ((ipproto = strtoul(protname, &garbage, 0)) >= 256) {
|
||||
Error2("xioopen_rawip_recv(\"%s\",,): protocol number exceeds 255 (%u)",
|
||||
protname, ipproto);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue