diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-10-18 19:48:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-10-18 19:50:29 +0200 |
commit | 2ff48e981e6cd1ccbfae49943274d9c8319a5e5d (patch) | |
tree | 10ec8200518d5d95476033dbb44df30ad7e34bf6 /src/libsystemd-network/dhcp6-network.c | |
parent | 0fef9583615435d41a7724b0c49f530433b4c572 (diff) | |
download | systemd-2ff48e981e6cd1ccbfae49943274d9c8319a5e5d.tar.gz |
tree-wide: introduce setsockopt_int() helper and make use of it everywhere
As suggested by @heftig:
https://github.com/systemd/systemd/commit/6d5e65f6454212cd400d0ebda34978a9f20cc26a#commitcomment-30938667
Diffstat (limited to 'src/libsystemd-network/dhcp6-network.c')
-rw-r--r-- | src/libsystemd-network/dhcp6-network.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsystemd-network/dhcp6-network.c b/src/libsystemd-network/dhcp6-network.c index 406b1efca4..580f43ba40 100644 --- a/src/libsystemd-network/dhcp6-network.c +++ b/src/libsystemd-network/dhcp6-network.c @@ -36,17 +36,17 @@ int dhcp6_network_bind_udp_socket(int index, struct in6_addr *local_address) { if (s < 0) return -errno; - r = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &const_int_one, sizeof(const_int_one)); + r = setsockopt_int(s, IPPROTO_IPV6, IPV6_V6ONLY, true); if (r < 0) - return -errno; + return r; - r = setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &const_int_zero, sizeof(const_int_zero)); + r = setsockopt_int(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, false); if (r < 0) - return -errno; + return r; - r = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &const_int_one, sizeof(const_int_one)); + r = setsockopt_int(s, SOL_SOCKET, SO_REUSEADDR, true); if (r < 0) - return -errno; + return r; r = bind(s, &src.sa, sizeof(src.in6)); if (r < 0) |