summaryrefslogtreecommitdiff
path: root/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Ports/stress-ng/patches/0003-missing-networking-functionality.patch')
-rw-r--r--Ports/stress-ng/patches/0003-missing-networking-functionality.patch96
1 files changed, 96 insertions, 0 deletions
diff --git a/Ports/stress-ng/patches/0003-missing-networking-functionality.patch b/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
new file mode 100644
index 0000000000..792e2a6433
--- /dev/null
+++ b/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
@@ -0,0 +1,96 @@
+diff -ur a/stress-sock.c b/stress-sock.c
+--- a/stress-sock.c 2020-11-07 10:52:22.000000000 -0800
++++ b/stress-sock.c 2020-11-08 22:51:33.327668500 -0800
+@@ -422,7 +422,7 @@
+ &cpu, &optlen);
+ }
+ #endif
+- if (socket_domain == AF_INET || socket_domain == AF_INET6) {
++ if (socket_domain == AF_INET) {
+ int val, ret;
+ socklen_t optlen;
+
+@@ -756,6 +756,8 @@
+ (void)close(sfd);
+ break;
+ }
++
++#if defined(SO_SNDBUF)
+ len = sizeof(sndbuf);
+ if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
+ pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
+@@ -763,6 +765,8 @@
+ (void)close(sfd);
+ break;
+ }
++#endif
++
+ #if defined(SOL_TCP) && defined(TCP_QUICKACK)
+ {
+ int ret, one = 1;
+diff -ur a/stress-sockabuse.c b/stress-sockabuse.c
+--- a/stress-sockabuse.c 2020-11-07 10:52:22.000000000 -0800
++++ b/stress-sockabuse.c 2020-11-08 22:52:27.297668500 -0800
+@@ -278,6 +278,7 @@
+ (void)close(sfd);
+ break;
+ }
++#if defined(SO_SNDBUF)
+ len = sizeof(sndbuf);
+ if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
+ pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
+@@ -285,6 +286,7 @@
+ (void)close(sfd);
+ break;
+ }
++#endif
+ (void)memset(buf, 'A' + (get_counter(args) % 26), sizeof(buf));
+
+ n = send(sfd, buf, sizeof(buf), 0);
+diff -ur a/stress-sockmany.c b/stress-sockmany.c
+--- a/stress-sockmany.c 2020-11-07 10:52:22.000000000 -0800
++++ b/stress-sockmany.c 2020-11-08 22:53:06.247668500 -0800
+@@ -221,6 +221,7 @@
+ (void)close(sfd);
+ break;
+ }
++#if defined(SO_SNDBUF)
+ len = sizeof(sndbuf);
+ if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sndbuf, &len) < 0) {
+ pr_fail("%s: getsockopt failed, errno=%d (%s)\n",
+@@ -228,6 +229,8 @@
+ (void)close(sfd);
+ break;
+ }
++#endif
++
+ #if defined(SOL_TCP) && defined(TCP_QUICKACK)
+ {
+ int ret, one = 1;
+diff -ur a/stress-resources.c b/stress-resources.c
+--- a/stress-resources.c 2020-11-07 10:52:22.000000000 -0800
++++ b/stress-resources.c 2020-11-08 23:20:35.227668500 -0800
+@@ -130,7 +130,7 @@
+ size_t i, n;
+ size_t shmall, freemem, totalmem, freeswap;
+ const pid_t pid = getpid();
+- static const int domains[] = { AF_INET, AF_INET6 };
++ static const int domains[] = { AF_INET };
+ static const int types[] = { SOCK_STREAM, SOCK_DGRAM };
+ static stress_info_t info[MAX_LOOPS];
+ #if defined(O_NOATIME)
+@@ -309,11 +309,13 @@
+ if (!keep_stressing_flag())
+ break;
+
++#if 0
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0,
+ info[i].fd_socketpair) < 0) {
+ info[i].fd_socketpair[0] = -1;
+ info[i].fd_socketpair[1] = -1;
+ }
++#endif
+
+ #if defined(HAVE_USERFAULTFD)
+ info[i].fd_uf = shim_userfaultfd(0);
+d