On Fri, 30 Oct 2026 01:28:58 +0900
Hayato Kiwata
If fwd_listen_init() fails while switching to new forwarding rules received from pesto, we currently close the old listening sockets, report an error and keep the (partially bound) new rules. That leaves pasta in a state the user didn't ask for.
Make fwd_listen_switch() return the result of fwd_listen_init(), and call it a second time from conf_handler() on failure to switch back to the old rules.
Ah, right, brilliant! I didn't realise that it doesn't actually need any further change because the other rules are always in c->fwd_pending.
Don't reset the count of the old table after closing its sockets, so that the old rules stay in c->fwd_pending and can be restored. The pending tables are cleared by conf_handler() before receiving new rules anyway.
Note that reporting the failure to the client is left for a later patch.
Link: https://archives.passt.top/passt-dev/20261025153025.600a4fe9@elisabeth/ Signed-off-by: Hayato Kiwata
Applied, sorry for the delay. -- Stefano