Skip to content

Commit

Permalink
unbreak udp_stream test (missing bind(2)); ok jakob@
Browse files Browse the repository at this point in the history
  • Loading branch information
mfriedl committed Sep 17, 2008
1 parent 13b8121 commit a766cf8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions benchmarks/netperf/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.24 2007/09/15 21:30:26 simon Exp $
# $OpenBSD: Makefile,v 1.25 2008/09/17 12:39:17 markus Exp $

COMMENT= Network performance benchmark

DISTNAME= netperf-2.3
PKGNAME= ${DISTNAME}p1
PKGNAME= ${DISTNAME}p2
CATEGORIES= benchmarks net

MAINTAINER= Jakob Schlyter <[email protected]>
Expand Down
28 changes: 28 additions & 0 deletions benchmarks/netperf/patches/patch-nettest_bsd_c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$OpenBSD: patch-nettest_bsd_c,v 1.1 2008/09/17 12:39:17 markus Exp $
--- nettest_bsd.c.orig Wed Sep 3 20:35:56 2008
+++ nettest_bsd.c Wed Sep 3 20:36:04 2008
@@ -4885,6 +4885,24 @@ recv_udp_stream()
send_response();
exit(1);
}
+
+ if (!udp_stream_request->ipaddress && !udp_stream_request->port) {
+ struct sockaddr_in temp;
+
+ bzero(&temp,sizeof(temp));
+ temp.sin_port = 0;
+ temp.sin_family = AF_INET;
+ temp.sin_addr.s_addr = 0;
+ if (bind(s_data,
+ (struct sockaddr *)&temp,
+ sizeof(struct sockaddr_in)) < 0) {
+ fprintf(where,
+ "netperf: recv_udp_stream: data socket bind failed errno %d\n",
+ errno);
+ fprintf(where," port: %d\n",ntohs(temp.sin_port));
+ fflush(where);
+ }
+ }

udp_stream_response->test_length = udp_stream_request->test_length;

0 comments on commit a766cf8

Please sign in to comment.