resolved: ttl/hopcount sockopt is not a boolean

These are integer values, hence specify them as integers, not as
booleans.
This commit is contained in:
Lennart Poettering 2020-09-03 23:52:27 +02:00 committed by Yu Watanabe
parent 908dbc70d6
commit 5b49641015
3 changed files with 6 additions and 6 deletions

View File

@ -403,11 +403,11 @@ static int dns_scope_socket(
/* RFC 4795, section 2.5 requires the TTL to be set to 1 */
if (sa.sa.sa_family == AF_INET) {
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, true);
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, 1);
if (r < 0)
return r;
} else if (sa.sa.sa_family == AF_INET6) {
r = setsockopt_int(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, true);
r = setsockopt_int(fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, 1);
if (r < 0)
return r;
}

View File

@ -579,7 +579,7 @@ static int manager_dns_stub_tcp_fd(Manager *m) {
if (r < 0)
return r;
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, true);
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, 1);
if (r < 0)
return r;
@ -621,7 +621,7 @@ static int manager_dns_stub_tcp_fd_extra(Manager *m, DNSStubListenerExtra *l) {
if (r < 0)
goto fail;
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, true);
r = setsockopt_int(fd, IPPROTO_IP, IP_TTL, 1);
if (r < 0)
goto fail;

View File

@ -326,7 +326,7 @@ int manager_llmnr_ipv4_tcp_fd(Manager *m) {
return log_error_errno(errno, "LLMNR-IPv4(TCP): Failed to create socket: %m");
/* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
r = setsockopt_int(s, IPPROTO_IP, IP_TTL, true);
r = setsockopt_int(s, IPPROTO_IP, IP_TTL, 1);
if (r < 0)
return log_error_errno(r, "LLMNR-IPv4(TCP): Failed to set IP_TTL: %m");
@ -397,7 +397,7 @@ int manager_llmnr_ipv6_tcp_fd(Manager *m) {
return log_error_errno(errno, "LLMNR-IPv6(TCP): Failed to create socket: %m");
/* RFC 4795, section 2.5. requires setting the TTL of TCP streams to 1 */
r = setsockopt_int(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, true);
r = setsockopt_int(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, 1);
if (r < 0)
return log_error_errno(r, "LLMNR-IPv6(TCP): Failed to set IPV6_UNICAST_HOPS: %m");