Skip to content

Commit e391594

Browse files
committed
Fix: Allows address reuse for OCSP server
Enables the SO_REUSEADDR socket option to prevent "Address already in use" errors when restarting the OCSP server, improving its reliability and availability.
1 parent 35cae80 commit e391594

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ocsp/stapling/ocsp-server.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,11 @@ int main()
345345
perror("socket");
346346
goto cleanup;
347347
}
348+
int optval = 1;
349+
if (setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) {
350+
perror("setsockopt");
351+
goto cleanup;
352+
}
348353
memset(&serv_addr, 0, sizeof(serv_addr));
349354
serv_addr.sin_family = AF_INET;
350355
serv_addr.sin_addr.s_addr = INADDR_ANY;

0 commit comments

Comments
 (0)