Created attachment 43024 [details] Patch to fix FreeBSD bind()/connect() calls by passing correct sockaddr lengths (uses _bsd_sockaddr_len_fix() and sets sun_len where needed). No functional changes for Linux. On FreeBSD, bind() and connect() require the correct sockaddr length to be passed, including the sa_len/sun_len fields, otherwise the call may fail with EINVAL. This patch ensures the correct length is computed and applied in all affected places. The changes are minimal and guarded by #if defined(__FreeBSD__), so there is no impact on Linux or other platforms. Original patch prepared for the FreeBSD port of Slurm; refined during review by Vladimir Druzenko to minimize scope and keep diffs clean.