aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2025-03-26 14:44:05 +1100
committerStefano Brivio <sbrivio@redhat.com>2025-03-26 21:34:30 +0100
commitf67c488b81ca2a4d9f819b625fceab10b71fc3a5 (patch)
tree8e77a7323873b7ce0fe20b8620aea3ad4e8a6169
parent269cf6a12a5f89683daa8da9232cc2524d7a4ae2 (diff)
downloadpasst-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar.gz
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar.bz2
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar.lz
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar.xz
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.tar.zst
passt-f67c488b81ca2a4d9f819b625fceab10b71fc3a5.zip
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>
-rw-r--r--udp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/udp.c b/udp.c
index f417cea..96e48dd 100644
--- a/udp.c
+++ b/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);
}
/**