In Samba v4.15 or later releases, when smbd starts up on Linux earlier than v3.9 that does not support the SO_REUSEPORT socket option, the server will fail to start. Log messages similar to the following are generated.
../../source3/lib/util_sock.c:294(open_socket_in) open_socket_in: setsockopt(SO_REUSEPORT) failed: Protocol not available
../../source3/smbd/server.c:1097(smbd_open_one_socket) smbd_open_one_socket: open_socket_in failed: Protocol not available
../../source3/smbd/server.c:1264(open_sockets_smbd) open_sockets_smbd: No sockets available to bind to.
INTERNAL ERROR: open_sockets_smbd() failed in pid 12523 (4.16.3)
Samba v4.14 and earlier do not have this problem. Earlier versions of samba would continue to create a socket even if the SO_REUSEPORT option could not be set.
This problem appears to be introduced by
"lib: Properly return errno from open_socket_in()" (Commit : 72540222c2290dc041fb01018de7febe44a4ac0d )
The problem could be fixed by modifying open_socket_in() and removing the "goto fail" statement in the "#ifdef SO_REUSEPORT" block. I have tested this using v4.16.3 and it seems to resolve the issue.