forked from pool/netcat-openbsd
OBS-URL: https://build.opensuse.org/package/show/network:utilities/netcat-openbsd?expand=0&rev=29
17 lines
710 B
Diff
17 lines
710 B
Diff
Index: netcat-openbsd-1.229/netcat.c
|
|
===================================================================
|
|
--- netcat-openbsd-1.229.orig/netcat.c 2025-06-04 07:36:38.214088834 +0000
|
|
+++ netcat-openbsd-1.229/netcat.c 2025-06-04 07:36:53.985608901 +0000
|
|
@@ -1228,7 +1228,10 @@ remote_connect(const char *host, const c
|
|
ahints.ai_flags = AI_PASSIVE;
|
|
if ((error = getaddrinfo(sflag, pflag, &ahints, &ares)))
|
|
errx(1, "getaddrinfo: %s", gai_strerror(error));
|
|
-
|
|
+#ifdef IP_BIND_ADDRESS_NO_PORT
|
|
+ if(sflag && !pflag)
|
|
+ setsockopt(s, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on));
|
|
+#endif
|
|
if (bind(s, (struct sockaddr *)ares->ai_addr,
|
|
ares->ai_addrlen) == -1)
|
|
err(1, "bind failed");
|