aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2025-02-12 01:07:33 +0100
committerStefano Brivio <sbrivio@redhat.com>2025-02-12 19:46:46 +0100
commit836fe215e049ee423750d3315a02742d8224eab2 (patch)
tree494fe22b91995eda0336d3b91997bfde5f911384
parentdef7de4690ddb40f7c3b29e6ca81d30e9409fb5d (diff)
downloadpasst-836fe215e049ee423750d3315a02742d8224eab2.tar
passt-836fe215e049ee423750d3315a02742d8224eab2.tar.gz
passt-836fe215e049ee423750d3315a02742d8224eab2.tar.bz2
passt-836fe215e049ee423750d3315a02742d8224eab2.tar.lz
passt-836fe215e049ee423750d3315a02742d8224eab2.tar.xz
passt-836fe215e049ee423750d3315a02742d8224eab2.tar.zst
passt-836fe215e049ee423750d3315a02742d8224eab2.zip
passt-repair: Fix off-by-one in check for number of file descriptors
Actually, 254 is too many, but 253 isn't. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--passt-repair.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/passt-repair.c b/passt-repair.c
index 614cee0..1174ae3 100644
--- a/passt-repair.c
+++ b/passt-repair.c
@@ -131,7 +131,7 @@ loop:
/* No inverse formula for CMSG_LEN(x), and building one with CMSG_LEN(0)
* works but there's no guarantee it does. Search the whole domain.
*/
- for (i = 1; i < SCM_MAX_FD; i++) {
+ for (i = 1; i <= SCM_MAX_FD; i++) {
if (CMSG_LEN(sizeof(int) * i) == cmsg->cmsg_len) {
n = i;
break;