diff options
| author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2026-05-01 23:41:49 +0200 |
|---|---|---|
| committer | Sander Vrijders <sander@ouroboros.rocks> | 2026-05-20 08:17:05 +0200 |
| commit | 2ddcad3989cd8d2314453ed31ff43e122118663f (patch) | |
| tree | 201cbde8ccb850021ab54d1331a7c8ec3558793c /src/irmd/reg/reg.c | |
| parent | 44ca111c2b9cf45491edc99062f89c89060525ae (diff) | |
| download | ouroboros-2ddcad3989cd8d2314453ed31ff43e122118663f.tar.gz ouroboros-2ddcad3989cd8d2314453ed31ff43e122118663f.zip | |
irmd: Drop replayed flow alloc requests
A duplicating link could deliver the same alloc request twice.
OAP detected the replay but still replied over the wire, so the
requester saw a second flow_alloc_reply on an already-allocated
flow and reg_respond_alloc tripped its PENDING-state assertion.
Add EREPLAY so the OAP server can signal replays distinctly;
flow_accept drops them silently. As a safety net, reg_respond_alloc
warn-drops late replies instead of asserting.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/irmd/reg/reg.c')
| -rw-r--r-- | src/irmd/reg/reg.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/irmd/reg/reg.c b/src/irmd/reg/reg.c index 0025f695..365064e5 100644 --- a/src/irmd/reg/reg.c +++ b/src/irmd/reg/reg.c @@ -1820,7 +1820,11 @@ int reg_respond_alloc(struct flow_info * info, goto fail_flow; } - assert(flow->info.state == FLOW_ALLOC_PENDING); + if (flow->info.state != FLOW_ALLOC_PENDING) { + log_warn("Flow %d already responded.", info->id); + goto fail_flow; + } + assert(flow->rsp_data.len == 0); assert(flow->rsp_data.data == NULL); |
