summaryrefslogtreecommitdiff
path: root/src/dumm/bridge.c
diff options
context:
space:
mode:
authorRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
committerRene Mayrhofer <rene@mayrhofer.eu.org>2008-10-29 11:11:01 +0000
commit8b80ab5a6950ce6515f477624794defd7531642a (patch)
treeaa8303f3806c5615fbeafc4dc82febe3cd7c24dc /src/dumm/bridge.c
parentdb67c87db3c9089ea8d2e14f617bf3d9e2af261f (diff)
downloadvyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.tar.gz
vyos-strongswan-8b80ab5a6950ce6515f477624794defd7531642a.zip
[svn-upgrade] Integrating new upstream version, strongswan (4.2.8)
Diffstat (limited to 'src/dumm/bridge.c')
-rw-r--r--src/dumm/bridge.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/dumm/bridge.c b/src/dumm/bridge.c
index cb8017c78..209e54fc1 100644
--- a/src/dumm/bridge.c
+++ b/src/dumm/bridge.c
@@ -112,19 +112,23 @@ static bool connect_iface(private_bridge_t *this, iface_t *iface)
static int instances = 0;
/**
- * unregister an interface from bridge
- */
-static void unregister(iface_t *iface)
-{
- iface->set_bridge(iface, NULL);
-}
-
-/**
* Implementation of bridge_t.destroy.
*/
static void destroy(private_bridge_t *this)
{
- this->ifaces->invoke_function(this->ifaces, (linked_list_invoke_t)unregister);
+ enumerator_t *enumerator;
+ iface_t *iface;
+
+ enumerator = this->ifaces->create_enumerator(this->ifaces);
+ while (enumerator->enumerate(enumerator, (void**)&iface))
+ {
+ if (br_del_interface(this->name, iface->get_hostif(iface)) != 0)
+ {
+ DBG1("disconnecting iface '%s' failed: %m", iface->get_hostif(iface));
+ }
+ iface->set_bridge(iface, NULL);
+ }
+ enumerator->destroy(enumerator);
this->ifaces->destroy(this->ifaces);
iface_control(this->name, FALSE);
if (br_del_bridge(this->name) != 0)