mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 14:30:32 +00:00
Merge pull request #2103 from marcosps/forward_not_used
network.c: Remove ip_forward_set and callers
This commit is contained in:
commit
b28e282611
@ -1368,32 +1368,6 @@ static int proc_sys_net_write(const char *path, const char *value)
|
|||||||
return err;
|
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)
|
static int neigh_proxy_set(const char *ifname, int family, int flag)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -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,
|
extern int lxc_vlan_create(const char *master, const char *name,
|
||||||
unsigned short vid);
|
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. */
|
/* Set ip address. */
|
||||||
extern int lxc_ipv6_addr_add(int ifindex, struct in6_addr *addr,
|
extern int lxc_ipv6_addr_add(int ifindex, struct in6_addr *addr,
|
||||||
struct in6_addr *mcast,
|
struct in6_addr *mcast,
|
||||||
|
Loading…
Reference in New Issue
Block a user