]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
bridge_driver.c: more uses of SYSCTL_PATH
authorCédric Bosdonnat <cbosdonnat@suse.com>
Fri, 3 Mar 2017 13:13:49 +0000 (14:13 +0100)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Wed, 22 Mar 2017 08:01:32 +0000 (09:01 +0100)
Replace a few occurences of /proc/sys by the corresponding macro
defined a few lines after: SYSCTL_PATH

src/network/bridge_driver.c

index 32c5ab7a71889953a26c6aea8e167ec1fc9f05c9..4d1a44516b057103632215935e37d08c78cd0195 100644 (file)
@@ -85,6 +85,8 @@
  */
 #define VIR_NETWORK_DHCP_LEASE_FILE_SIZE_MAX (32 * 1024 * 1024)
 
+#define SYSCTL_PATH "/proc/sys"
+
 VIR_LOG_INIT("network.bridge_driver");
 
 static virNetworkDriverStatePtr network_driver;
@@ -2092,15 +2094,14 @@ networkEnableIPForwarding(bool enableIPv4, bool enableIPv6)
                            &enabled, sizeof(enabled));
 #else
     if (enableIPv4)
-        ret = virFileWriteStr("/proc/sys/net/ipv4/ip_forward", "1\n", 0);
+        ret = virFileWriteStr(SYSCTL_PATH "/net/ipv4/ip_forward", "1\n", 0);
     if (enableIPv6 && ret == 0)
-        ret = virFileWriteStr("/proc/sys/net/ipv6/conf/all/forwarding", "1\n", 0);
+        ret = virFileWriteStr(SYSCTL_PATH "/net/ipv6/conf/all/forwarding", "1\n", 0);
+
 #endif
     return ret;
 }
 
-#define SYSCTL_PATH "/proc/sys"
-
 static int
 networkSetIPv6Sysctls(virNetworkObjPtr network)
 {