Commit 7d163508 by Michel Normand Committed by Daniel Lezcano

lxc: remove unused lxc_bridge_detach

parent 3cfc0f3a
...@@ -753,8 +753,11 @@ out: ...@@ -753,8 +753,11 @@ out:
return err; return err;
} }
static int bridge_add_del_interface(const char *bridge, /*
const char *ifname, int detach) * There is a lxc_bridge_attach, but no need of a bridge detach
* as automatically done by kernel when device deleted.
*/
int lxc_bridge_attach(const char *bridge, const char *ifname)
{ {
int fd, index, err; int fd, index, err;
struct ifreq ifr; struct ifreq ifr;
...@@ -772,20 +775,10 @@ static int bridge_add_del_interface(const char *bridge, ...@@ -772,20 +775,10 @@ static int bridge_add_del_interface(const char *bridge,
strncpy(ifr.ifr_name, bridge, IFNAMSIZ); strncpy(ifr.ifr_name, bridge, IFNAMSIZ);
ifr.ifr_ifindex = index; ifr.ifr_ifindex = index;
err = ioctl(fd, detach?SIOCBRDELIF:SIOCBRADDIF, &ifr); err = ioctl(fd, SIOCBRADDIF, &ifr);
close(fd); close(fd);
if (err) if (err)
err = -errno; err = -errno;
return err; return err;
} }
int lxc_bridge_attach(const char *bridge, const char *ifname)
{
return bridge_add_del_interface(bridge, ifname, 0);
}
int lxc_bridge_detach(const char *bridge, const char *ifname)
{
return bridge_add_del_interface(bridge, ifname, 1);
}
...@@ -98,11 +98,6 @@ extern int lxc_ip_addr_add(int family, int ifindex, void *addr, int prefix); ...@@ -98,11 +98,6 @@ extern int lxc_ip_addr_add(int family, int ifindex, void *addr, int prefix);
*/ */
extern int lxc_bridge_attach(const char *bridge, const char *ifname); extern int lxc_bridge_attach(const char *bridge, const char *ifname);
/*
* Detach an interface from the bridge
*/
extern int lxc_bridge_detach(const char *bridge, const char *ifname);
/* /*
* Create default gateway * Create default gateway
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment