Subject: [PATCH] Keep retained shared listeners linked during interface GC release_listener() can retain a listener by transferring its iface pointer to another interface record which uses the same address. In that case it returns zero, but enumerate_interfaces() does not advance the pointer-to-pointer cursor. If the next listener is removed, updating the stale cursor unlinks the retained listener as well. Advance the cursor when release_listener() retains a shared listener, just as when the original iface remains found. This is independent of the larger interface-snapshot transaction change. The existing shared-listener regression in the snapshot test harness covers preservation of the list link, iface ownership and socket inode. Base-commit: a9880c595f052d63859d6ed8aa86a3a6b007bf20 --- src/network.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/network.c b/src/network.c index 6c4469dcb0e9c2e72a5874bbd8d69c630d966924..aa3ef89e714169dd523c567ddd331d217afb9fce 100644 --- a/src/network.c +++ b/src/network.c @@ -868,6 +868,8 @@ again: *up = tmp; freed = 1; } + else + up = &l->next; } if (freed)