[lxc-devel] [lxc/master] network.c: Remove ip_forward_set and callers

marcosps on Github lxc-bot at linuxcontainers.org
Tue Jan 23 00:08:07 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 666 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180123/7365d2e7/attachment.bin>
-------------- next part --------------
From c0a6d713b237db2fbb2a2e0a23885c32718071d2 Mon Sep 17 00:00:00 2001
From: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date: Mon, 22 Jan 2018 22:04:03 -0200
Subject: [PATCH] network.c: Remove ip_forward_set and callers

The last user of ip_forward_set, lxc_ip_forward_on and
lxc_ip_forward_off was in 2009:

commit 92d385229be040cf034ac6efd9405b7bdfe06a3e
Author: Daniel Lezcano <dlezcano at fr.ibm.com>
Date:   Thu Oct 22 15:33:40 2009 +0200

    remove test directory

These functions are not called anymore.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
---
 src/lxc/network.c | 26 --------------------------
 src/lxc/network.h |  6 ------
 2 files changed, 32 deletions(-)

diff --git a/src/lxc/network.c b/src/lxc/network.c
index 3954a4f57..e52f0cf0b 100644
--- a/src/lxc/network.c
+++ b/src/lxc/network.c
@@ -1368,32 +1368,6 @@ static int proc_sys_net_write(const char *path, const char *value)
 	return err;
 }
 
-static int ip_forward_set(const char *ifname, int family, int flag)
-{
-	int rc;
-	char path[MAXPATHLEN];
-
-	if (family != AF_INET && family != AF_INET6)
-		return -EINVAL;
-
-	rc = snprintf(path, MAXPATHLEN, "/proc/sys/net/%s/conf/%s/forwarding",
-		      family == AF_INET ? "ipv4" : "ipv6", ifname);
-	if (rc < 0 || (size_t)rc >= MAXPATHLEN)
-		return -E2BIG;
-
-	return proc_sys_net_write(path, flag ? "1" : "0");
-}
-
-int lxc_ip_forward_on(const char *ifname, int family)
-{
-	return ip_forward_set(ifname, family, 1);
-}
-
-int lxc_ip_forward_off(const char *ifname, int family)
-{
-	return ip_forward_set(ifname, family, 0);
-}
-
 static int neigh_proxy_set(const char *ifname, int family, int flag)
 {
 	int ret;
diff --git a/src/lxc/network.h b/src/lxc/network.h
index 971ef367d..9b9858a52 100644
--- a/src/lxc/network.h
+++ b/src/lxc/network.h
@@ -207,12 +207,6 @@ extern int lxc_macvlan_create(const char *master, const char *name, int mode);
 extern int lxc_vlan_create(const char *master, const char *name,
 			   unsigned short vid);
 
-/* Activate forwarding.*/
-extern int lxc_ip_forward_on(const char *name, int family);
-
-/* Disable forwarding. */
-extern int lxc_ip_forward_off(const char *name, int family);
-
 /* Set ip address. */
 extern int lxc_ipv6_addr_add(int ifindex, struct in6_addr *addr,
 			     struct in6_addr *mcast,


More information about the lxc-devel mailing list