summaryrefslogtreecommitdiff
path: root/regress/sys
diff options
context:
space:
mode:
Diffstat (limited to 'regress/sys')
-rw-r--r--regress/sys/kern/sosplice/perf/Makefile4
-rw-r--r--regress/sys/kern/sosplice/perf/relay.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/regress/sys/kern/sosplice/perf/Makefile b/regress/sys/kern/sosplice/perf/Makefile
index 81676cd0625..28119e762c6 100644
--- a/regress/sys/kern/sosplice/perf/Makefile
+++ b/regress/sys/kern/sosplice/perf/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2013/01/08 21:42:19 bluhm Exp $
+# $OpenBSD: Makefile,v 1.2 2014/01/08 23:32:17 bluhm Exp $
PROG ?= relay
CFLAGS += -Wall -Werror
@@ -20,6 +20,8 @@ copy splice: ${PROG}
.for r in copy splice
run-regress-$p-$r: $r
+ @echo
+ @echo $@
.if empty (REMOTE_SSH)
./$r ${p:S/tcp//:S/udp/-u/} 12345 localhost 12346 & \
rpid=$$! ; \
diff --git a/regress/sys/kern/sosplice/perf/relay.c b/regress/sys/kern/sosplice/perf/relay.c
index aab8cbf4fa4..699a1b56aaf 100644
--- a/regress/sys/kern/sosplice/perf/relay.c
+++ b/regress/sys/kern/sosplice/perf/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.1 2013/01/08 21:42:19 bluhm Exp $ */
+/* $OpenBSD: relay.c,v 1.2 2014/01/08 23:32:17 bluhm Exp $ */
/*
* Copyright (c) 2013 Alexander Bluhm <bluhm@openbsd.org>
*
@@ -142,6 +142,10 @@ socket_listen(int *ls, struct addrinfo *hints, const char *listenaddr,
cause = "listen socket";
continue;
}
+ optval = 100000;
+ if (setsockopt(ls[nls], SOL_SOCKET, SO_RCVBUF,
+ &optval, sizeof(optval)) == -1)
+ err(1, "setsockopt rcvbuf");
optval = 1;
if (setsockopt(ls[nls], SOL_SOCKET, SO_REUSEADDR,
&optval, sizeof(optval)) == -1)
@@ -229,7 +233,7 @@ socket_connect(struct addrinfo *hints, const char *hostname, const char *port)
socklen_t salen;
struct addrinfo *res, *res0;
const char *cause = NULL;
- int error, save_errno, cs;
+ int optval, error, save_errno, cs;
hints->ai_flags = 0;
error = getaddrinfo(hostname, port, hints, &res0);
@@ -244,6 +248,10 @@ socket_connect(struct addrinfo *hints, const char *hostname, const char *port)
cause = "connect socket";
continue;
}
+ optval = 100000;
+ if (setsockopt(cs, SOL_SOCKET, SO_SNDBUF,
+ &optval, sizeof(optval)) == -1)
+ err(1, "setsockopt sndbuf");
if (connect(cs, res->ai_addr, res->ai_addrlen) == -1) {
cause = "connect";
save_errno = errno;