summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/interface.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/core/interface.c b/src/core/interface.c
index a700d2e4..f7802be0 100644
--- a/src/core/interface.c
+++ b/src/core/interface.c
@@ -271,6 +271,7 @@ void intf_close ( struct interface *intf, int rc ) {
* unplugs the interface.
*/
void intf_shutdown ( struct interface *intf, int rc ) {
+ struct interface tmp;
DBGC ( INTF_COL ( intf ), "INTF " INTF_FMT " shutting down (%s)\n",
INTF_DBG ( intf ), strerror ( rc ) );
@@ -278,11 +279,15 @@ void intf_shutdown ( struct interface *intf, int rc ) {
/* Block further operations */
intf_nullify ( intf );
- /* Notify destination of close */
- intf_close ( intf, rc );
+ /* Transfer destination to temporary interface */
+ tmp.dest = intf->dest;
+ intf->dest = &null_intf;
+
+ /* Notify destination of close via temporary interface */
+ intf_close ( &tmp, rc );
- /* Unplug interface */
- intf_unplug ( intf );
+ /* Unplug temporary interface */
+ intf_unplug ( &tmp );
}
/**