mirror of
https://passt.top/passt
synced 2025-05-24 02:05:33 +02:00
migrate, flow: Don't attempt to migrate TCP flows without passt-repair
Migrating TCP flows requires passt-repair in order to use TCP_REPAIR. If passt-repair is not started, our failure mode is pretty ugly though: we'll attempt the migration, hitting various problems when we can't enter repair mode. In some cases we may not roll back these changes properly, meaning we break network connections on the source. Our general approach is not to completely block migration if there are problems, but simply to break any flows we can't migrate. So, if we have no connection from passt-repair carry on with the migration, but don't attempt to migrate any TCP connections. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
2aa1b789b4
commit
83f95ade5b
1 changed files with 9 additions and 2 deletions
11
flow.c
11
flow.c
|
@ -943,6 +943,10 @@ static int flow_migrate_repair_all(struct ctx *c, bool enable)
|
|||
unsigned i;
|
||||
int rc;
|
||||
|
||||
/* If we don't have a repair helper, there's nothing we can do */
|
||||
if (c->fd_repair < 0)
|
||||
return 0;
|
||||
|
||||
foreach_established_tcp_flow(i, flow, FLOW_MAX) {
|
||||
if (enable)
|
||||
rc = tcp_flow_repair_on(c, &flow->tcp);
|
||||
|
@ -1007,8 +1011,11 @@ int flow_migrate_source(struct ctx *c, const struct migrate_stage *stage,
|
|||
(void)c;
|
||||
(void)stage;
|
||||
|
||||
foreach_established_tcp_flow(i, flow, FLOW_MAX)
|
||||
count++;
|
||||
/* If we don't have a repair helper, we can't migrate TCP flows */
|
||||
if (c->fd_repair >= 0) {
|
||||
foreach_established_tcp_flow(i, flow, FLOW_MAX)
|
||||
count++;
|
||||
}
|
||||
|
||||
count = htonl(count);
|
||||
if (write_all_buf(fd, &count, sizeof(count))) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue