aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@openbsd.org>2026-07-29 14:10:03 +0200
committerTheo Buehler <tb@openbsd.org>2026-07-29 14:10:03 +0200
commitd4e35851df280ec5f26c3d0942c39d9d098b43a0 (patch)
tree6285417d1d05c0241aa6bc31433b74aeef1ed019
parent3d686a7cbd84221fde5d7e03fa47896f6abf1d6c (diff)
parent77bf7f28ec393eae42719aea28b9191fa4c0d7cb (diff)
downloadportable-d4e35851df280ec5f26c3d0942c39d9d098b43a0.tar.gz
portable-d4e35851df280ec5f26c3d0942c39d9d098b43a0.tar.bz2
portable-d4e35851df280ec5f26c3d0942c39d9d098b43a0.zip
Land #1339 - fix unsupported setsockopt handling for minttl
-rw-r--r--patches/netcat.c.patch10
1 files changed, 8 insertions, 2 deletions
diff --git a/patches/netcat.c.patch b/patches/netcat.c.patch
index 0383034..216debc 100644
--- a/patches/netcat.c.patch
+++ b/patches/netcat.c.patch
@@ -131,7 +131,7 @@
131 } 131 }
132 if (Iflag) { 132 if (Iflag) {
133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, 133 if (setsockopt(s, SOL_SOCKET, SO_RCVBUF,
134@@ -1612,13 +1641,17 @@ set_common_sockopts(int s, int af) 134@@ -1612,13 +1641,23 @@ set_common_sockopts(int s, int af)
135 } 135 }
136 136
137 if (minttl != -1) { 137 if (minttl != -1) {
@@ -139,6 +139,9 @@
139 if (af == AF_INET && setsockopt(s, IPPROTO_IP, 139 if (af == AF_INET && setsockopt(s, IPPROTO_IP,
140 IP_MINTTL, &minttl, sizeof(minttl))) 140 IP_MINTTL, &minttl, sizeof(minttl)))
141 err(1, "set IP min TTL"); 141 err(1, "set IP min TTL");
142+#else
143+ if (af == AF_INET)
144+ errx(1, "set IP min TTL not supported");
142+#endif 145+#endif
143 146
144- else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, 147- else if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
@@ -146,11 +149,14 @@
146+ if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6, 149+ if (af == AF_INET6 && setsockopt(s, IPPROTO_IPV6,
147 IPV6_MINHOPCOUNT, &minttl, sizeof(minttl))) 150 IPV6_MINHOPCOUNT, &minttl, sizeof(minttl)))
148 err(1, "set IPv6 min hop count"); 151 err(1, "set IPv6 min hop count");
152+#else
153+ if (af == AF_INET6)
154+ errx(1, "set IPv6 min hop count not supported");
149+#endif 155+#endif
150 } 156 }
151 } 157 }
152 158
153@@ -1849,15 +1882,19 @@ help(void) 159@@ -1849,15 +1888,19 @@ help(void)
154 \t-P proxyuser\tUsername for proxy authentication\n\ 160 \t-P proxyuser\tUsername for proxy authentication\n\
155 \t-p port\t Specify local port for remote connects\n\ 161 \t-p port\t Specify local port for remote connects\n\
156 \t-R CAfile CA bundle\n\ 162 \t-R CAfile CA bundle\n\