Skip to content

Commit

Permalink
network.c: Remove ip_forward_set and callers
Browse files Browse the repository at this point in the history
The last user of ip_forward_set, lxc_ip_forward_on and
lxc_ip_forward_off was in 2009:

commit 92d3852
Author: Daniel Lezcano <dlezcano@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@gmail.com>
  • Loading branch information
marcosps committed Jan 23, 2018
1 parent f947066 commit c0a6d71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
26 changes: 0 additions & 26 deletions src/lxc/network.c
Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions src/lxc/network.h
Expand Up @@ -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,
Expand Down

0 comments on commit c0a6d71

Please sign in to comment.