]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/util: add a comment to struct server_id_buf
authorStefan Metzmacher <metze@samba.org>
Fri, 2 Aug 2024 06:25:16 +0000 (08:25 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 21 Aug 2024 08:02:30 +0000 (08:02 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/server_id.h

index 5b723d5cda40d100a36b24fa76f7d548dc0ec58d..988dd56de65e6480a417b8aa7bc488555df5bc4d 100644 (file)
 
 struct server_id;
 
-struct server_id_buf { char buf[48]; }; /* probably a bit too large ... */
+struct server_id_buf {
+       /*
+        * 4294967295 uses 10 chars
+        * 18446744073709551615 uses 20 chars
+        *
+        * We have these combinations:
+        * - "disconnected"
+        * - PID64
+        * - PID64.TASK32
+        * - VNN32:PID64.TASK32
+        *
+        * The largest has 10 + 1 + 20 + 1 + 10 + 1 = 43 chars
+        *
+        * Then we align it to a multiple of 8.
+        */
+       char buf[48];
+};
 
 bool server_id_same_process(const struct server_id *p1,
                            const struct server_id *p2);