mirror of
https://passt.top/passt
synced 2025-05-21 00:35:34 +02:00
udp: Better handling of failure to forward from reply socket
In udp_reply_sock_handler() if we're unable to forward the datagrams we just print an error. Generally this means we have an unsupported pair of pifs in the flow table, though, and that hasn't change. So, next time we get a matching packet we'll just get the same failure. In vhost-user mode we don't even dequeue the incoming packets which triggered this so we're likely to get the same failure immediately. Instead, close the flow, in the same we we do for an unrecoverable error. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
parent
269cf6a12a
commit
f67c488b81
1 changed files with 8 additions and 7 deletions
15
udp.c
15
udp.c
|
@ -812,9 +812,7 @@ void udp_reply_sock_handler(const struct ctx *c, union epoll_ref ref,
|
|||
if (events & EPOLLERR) {
|
||||
if (udp_sock_errs(c, ref) < 0) {
|
||||
flow_err(uflow, "Unrecoverable error on reply socket");
|
||||
flow_err_details(uflow);
|
||||
udp_flow_close(c, uflow);
|
||||
return;
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -829,12 +827,15 @@ void udp_reply_sock_handler(const struct ctx *c, union epoll_ref ref,
|
|||
ret = udp_buf_reply_sock_data(c, s, tosidx, now);
|
||||
|
||||
if (!ret) {
|
||||
flow_err(uflow,
|
||||
"No support for forwarding UDP from %s to %s",
|
||||
pif_name(pif_at_sidx(ref.flowside)),
|
||||
pif_name(pif_at_sidx(tosidx)));
|
||||
flow_err(uflow, "Unable to forward UDP");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
fail:
|
||||
flow_err_details(uflow);
|
||||
udp_flow_close(c, uflow);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue