summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJob Snijders <job@cvs.openbsd.org>2022-08-08 14:10:11 +0000
committerJob Snijders <job@cvs.openbsd.org>2022-08-08 14:10:11 +0000
commitb64f88818373aea94df13e1f2fc3006363383933 (patch)
treecd6dab46ee76257eeb51d0ceacabfa943cbf2c3c /usr.sbin
parent2c56b01a18fc4cacc0b9509a2657a57be470d69b (diff)
Set rsync connection timeout to 15 seconds.
OK sthen@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/rpki-client/extern.h5
-rw-r--r--usr.sbin/rpki-client/rsync.c3
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/rpki-client/extern.h b/usr.sbin/rpki-client/extern.h
index fc79967a615..611632db15a 100644
--- a/usr.sbin/rpki-client/extern.h
+++ b/usr.sbin/rpki-client/extern.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.h,v 1.143 2022/06/27 10:18:27 job Exp $ */
+/* $OpenBSD: extern.h,v 1.144 2022/08/08 14:10:10 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -727,6 +727,9 @@ int mkpathat(int, const char *);
#define MAX_HTTP_REQUESTS 64
#define MAX_RSYNC_REQUESTS 16
+/* How many seconds to wait for a connection to succeed. */
+#define MAX_CONTIMEOUT 15
+
/* Maximum allowd repositories per tal */
#define MAX_REPO_PER_TAL 1000
diff --git a/usr.sbin/rpki-client/rsync.c b/usr.sbin/rpki-client/rsync.c
index 537822f4d78..996d48129c9 100644
--- a/usr.sbin/rpki-client/rsync.c
+++ b/usr.sbin/rpki-client/rsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsync.c,v 1.38 2022/05/24 09:20:49 claudio Exp $ */
+/* $OpenBSD: rsync.c,v 1.39 2022/08/08 14:10:10 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -312,6 +312,7 @@ proc_rsync(char *prog, char *bind_addr, int fd)
args[i++] = "-rt";
args[i++] = "--no-motd";
args[i++] = "--max-size=" STRINGIFY(MAX_FILE_SIZE);
+ args[i++] = "--contimeout=" STRINGIFY(MAX_CONTIMEOUT);
args[i++] = "--timeout=180";
args[i++] = "--include=*/";
args[i++] = "--include=*.cer";