Summary: | Fix FreeBSD bind() and connect() calls: pass correct sockaddr length | ||
---|---|---|---|
Product: | Slurm | Reporter: | Rikka Göring <rikka.goering> |
Component: | slurmd | Assignee: | Tim Wickberg <tim> |
Status: | OPEN --- | QA Contact: | |
Severity: | C - Contributions | ||
Priority: | --- | ||
Version: | 23.11.7 | ||
Hardware: | Other | ||
OS: | Other | ||
Site: | -Other- | Slinky Site: | --- |
Alineos Sites: | --- | Atos/Eviden Sites: | --- |
Confidential Site: | --- | Coreweave sites: | --- |
Cray Sites: | --- | DS9 clusters: | --- |
Google sites: | --- | HPCnow Sites: | --- |
HPE Sites: | --- | IBM Sites: | --- |
NOAA SIte: | --- | NoveTech Sites: | --- |
Nvidia HWinf-CS Sites: | --- | OCF Sites: | --- |
Recursion Pharma Sites: | --- | SFW Sites: | --- |
SNIC sites: | --- | Tzag Elita Sites: | --- |
Linux Distro: | --- | Machine Name: | |
CLE Version: | Version Fixed: | ||
Target Release: | --- | DevPrio: | --- |
Emory-Cloud Sites: | --- | ||
Attachments: | 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. |
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.