summaryrefslogtreecommitdiff
path: root/sysdep/unix
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-01-31 13:11:55 +0100
committerMaria Matejka <mq@ucw.cz>2023-02-02 14:40:00 +0100
commite077d0e770f00c98f26ee6b3cdb7905bf9bea4c1 (patch)
tree0d8c8254d591588c0b255a422bacafebe78f8d1a /sysdep/unix
parent05d8c3699d51866c68747167556e7c1f06390afe (diff)
Moved interface list flush to device protocol cleanup hook.
The interface list must be flushed when device protocol is stopped. This was done in a hardcoded specific hook inside generic protocol routines. The cleanup hook was originally used for table reference counting late cleanup, yet it can be also simply used for prettier interface list flush.
Diffstat (limited to 'sysdep/unix')
-rw-r--r--sysdep/unix/krt.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index 9f95247f..7ec30eb0 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -163,6 +163,15 @@ kif_shutdown(struct proto *P)
return PS_DOWN;
}
+static void
+kif_cleanup(struct proto *p)
+{
+ if (p->debug & D_EVENTS)
+ log(L_TRACE "%s: Flushing interfaces", p->name);
+ if_start_update();
+ if_end_update();
+}
+
static int
kif_reconfigure(struct proto *p, struct proto_config *new)
{
@@ -239,6 +248,7 @@ struct protocol proto_unix_iface = {
.init = kif_init,
.start = kif_start,
.shutdown = kif_shutdown,
+ .cleanup = kif_cleanup,
.reconfigure = kif_reconfigure,
.copy_config = kif_copy_config
};