<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- src/relayd.c
+++ src/relayd.c
@@ -257,9 +257,21 @@
	memcpy (&amp;s.addr, addr, sizeof (s.addr));
	s.mtu = (uint16_t)mtu;

+#ifdef MSG_NOSIGNAL
	if ((send (fd, &amp;s, sizeof (s), MSG_NOSIGNAL) != sizeof (s))
	 || (recv (fd, &amp;res, sizeof (res), MSG_WAITALL) != sizeof (res)))
		return -1;
+#else
+	int set = 1;
+	setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&amp;set, sizeof(int));
+
+	if ((send (fd, &amp;s, sizeof (s), 0) != sizeof (s))
+	 || (recv (fd, &amp;res, sizeof (res), MSG_WAITALL) != sizeof (res)))
+		res = -1;
+
+	set = 0;
+	setsockopt(fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&amp;set, sizeof(int));
+#endif

	return res;
 }
</pre></body></html>