summaryrefslogtreecommitdiff
path: root/nest/iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/iface.c')
-rw-r--r--nest/iface.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/nest/iface.c b/nest/iface.c
index 2b14d3f0..d871ff33 100644
--- a/nest/iface.c
+++ b/nest/iface.c
@@ -253,6 +253,24 @@ if_change_flags(struct iface *i, unsigned flags)
}
/**
+ * if_delete - remove interface
+ * @old: interface
+ *
+ * This function is called by the low-level platform dependent code
+ * whenever it notices an interface disappears. It is just a shorthand
+ * for if_update().
+ */
+
+void
+if_delete(struct iface *old)
+{
+ struct iface f = {};
+ strncpy(f.name, old->name, sizeof(f.name)-1);
+ f.flags = IF_SHUTDOWN;
+ if_update(&f);
+}
+
+/**
* if_update - update interface status
* @new: new interface status
*
@@ -400,7 +418,7 @@ if_find_by_index(unsigned idx)
struct iface *i;
WALK_LIST(i, iface_list)
- if (i->index == idx)
+ if (i->index == idx && !(i->flags & IF_SHUTDOWN))
return i;
return NULL;
}