On Mon, 19 Feb 2024 18:56:51 +1100
David Gibson <david(a)gibson.dropbear.id.au> wrote:
If tcp_sock_refill_pool() gets an error opening
new sockets, it stores the
negative errno of that error in the socket pool. This isn't especially
useful:
* It's inconsistent with the initial state of the pool (all -1)
* It's inconsistent with the state of an entry that was valid and was
then consumed (also -1)
* By the time we did anything with this error code, it's now far removed
from the situation in which the error occurred, making it difficult to
report usefully
We now have error reporting closer to when failures happen on the refill
paths, so just leave a pool slot we can't fill as -1.
Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au>
---
tcp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/tcp.c b/tcp.c
index 34e32641..27865691 100644
--- a/tcp.c
+++ b/tcp.c
@@ -3039,11 +3039,13 @@ int tcp_sock_refill_pool(const struct ctx *c, int pool[],
sa_family_t af)
int i;
for (i = 0; i < TCP_SOCK_POOL_SIZE; i++) {
+ int fd;
Usual newline between declaration and code. Rest of the series looks
good to me, same as 4/6, if you agree I can fix it up, or respin, you
choose.
Oops. Go ahead and fix on merge, please.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!