summaryrefslogtreecommitdiffstats
path: root/src/network/networkd-ipv6-proxy-ndp.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-02-18 06:30:32 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-02-21 02:38:10 +0100
commit62e021a95dba73e200797de04c5669a864ff13a1 (patch)
tree8a7170ffa447a52af9995f8895fb03f7177b4fce /src/network/networkd-ipv6-proxy-ndp.c
parentsysctl-util: introduce sysctl_write_ip_property() and friends (diff)
downloadsystemd-62e021a95dba73e200797de04c5669a864ff13a1.tar.xz
systemd-62e021a95dba73e200797de04c5669a864ff13a1.zip
network: use sysctl_write_ip_property() and friends
Diffstat (limited to 'src/network/networkd-ipv6-proxy-ndp.c')
-rw-r--r--src/network/networkd-ipv6-proxy-ndp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c
index 2a45dd9489..98d4205547 100644
--- a/src/network/networkd-ipv6-proxy-ndp.c
+++ b/src/network/networkd-ipv6-proxy-ndp.c
@@ -10,8 +10,9 @@
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-network.h"
-#include "string-util.h"
#include "socket-util.h"
+#include "string-util.h"
+#include "sysctl-util.h"
static bool ipv6_proxy_ndp_is_needed(Link *link) {
assert(link);
@@ -32,8 +33,8 @@ static bool ipv6_proxy_ndp_is_needed(Link *link) {
}
static int ipv6_proxy_ndp_set(Link *link) {
- const char *p = NULL;
- int r, v;
+ bool v;
+ int r;
assert(link);
@@ -41,9 +42,8 @@ static int ipv6_proxy_ndp_set(Link *link) {
return 0;
v = ipv6_proxy_ndp_is_needed(link);
- p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/proxy_ndp");
- r = write_string_file(p, one_zero(v), WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "proxy_ndp", v);
if (r < 0)
log_link_warning_errno(link, r, "Cannot configure proxy NDP for interface: %m");