summaryrefslogtreecommitdiff
path: root/sbin/iked/ocsp.c
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2015-11-23 19:28:35 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2015-11-23 19:28:35 +0000
commit2bfadaff0e5648be7030c20df9542a615ec8496a (patch)
treea22db61ef28a750b8f940b6b0581ce214bb524f8 /sbin/iked/ocsp.c
parentc2f4f4e14bdbbe058f3635a258a5996514f45861 (diff)
Replace socket_set_blockmode() and fcntl(fd, F_SETFL, O_NONBLOCK) calls
with the SOCK_NONBLOCK flag to socket() and accept4(). OK claudio@ jung@
Diffstat (limited to 'sbin/iked/ocsp.c')
-rw-r--r--sbin/iked/ocsp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/iked/ocsp.c b/sbin/iked/ocsp.c
index 37356d8049d..11f9349520e 100644
--- a/sbin/iked/ocsp.c
+++ b/sbin/iked/ocsp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ocsp.c,v 1.6 2015/08/21 11:59:27 reyk Exp $ */
+/* $OpenBSD: ocsp.c,v 1.7 2015/11/23 19:28:34 reyk Exp $ */
/*
* Copyright (c) 2014 Markus Friedl
@@ -88,7 +88,7 @@ ocsp_connect(struct iked *env)
goto done;
}
- if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
+ if ((fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0)) < 0) {
log_debug("%s: socket failed", __func__);
goto done;
}
@@ -122,7 +122,6 @@ ocsp_connect(struct iked *env)
path = NULL;
log_debug("%s: connect(%s, %s)", __func__, host, port);
- socket_set_blockmode(fd, BM_NONBLOCK);
if (connect(fd, res->ai_addr, res->ai_addrlen) == -1) {
/* register callback for ansync connect */
if (errno == EINPROGRESS) {