diff --git a/flow.c b/flow.c index b187dff..4d611f5 100644 --- a/flow.c +++ b/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))) {