From e077d0e770f00c98f26ee6b3cdb7905bf9bea4c1 Mon Sep 17 00:00:00 2001 From: Maria Matejka Date: Tue, 31 Jan 2023 13:11:55 +0100 Subject: 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. --- nest/proto.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'nest/proto.c') diff --git a/nest/proto.c b/nest/proto.c index 26d648f3..0ca72ead 100644 --- a/nest/proto.c +++ b/nest/proto.c @@ -968,11 +968,8 @@ proto_event(void *ptr) if (p->do_stop) { - if (p->proto == &proto_unix_iface) - if_flush_ifaces(p); p->do_stop = 0; } - if (proto_is_done(p)) { if (p->proto->cleanup) @@ -1863,8 +1860,6 @@ proto_do_stop(struct proto *p) p->down_sched = 0; p->gr_recovery = 0; - p->do_stop = 1; - ev_schedule(p->event); if (p->main_source) { @@ -1873,6 +1868,9 @@ proto_do_stop(struct proto *p) } proto_stop_channels(p); + + p->do_stop = 1; + ev_schedule(p->event); } static void -- cgit v1.2.3