Accepting request 856314 from network:utilities

OBS-URL: https://build.opensuse.org/request/show/856314
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/netcat-openbsd?expand=0&rev=27
This commit is contained in:
Dominique Leuenberger 2020-12-18 18:52:10 +00:00 committed by Git OBS Bridge
commit 3aad6fee5e
3 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,35 @@
Index: netcat-openbsd-1.203/netcat.c
===================================================================
--- netcat-openbsd-1.203.orig/netcat.c
+++ netcat-openbsd-1.203/netcat.c
@@ -1889,6 +1889,21 @@ udptest(int s)
return 1;
}
+static int
+enable_icmp_errors (int family, int fd)
+{
+ int one = 1;
+ switch (family)
+ {
+ case AF_INET:
+ return setsockopt (fd, SOL_IP, IP_RECVERR, &one, sizeof (one));
+ case AF_INET6:
+ return setsockopt (fd, SOL_IPV6, IPV6_RECVERR, &one, sizeof (one));
+ default:
+ return -1;
+ }
+}
+
void
set_common_sockopts(int s, const struct sockaddr* sa)
{
@@ -1982,6 +1997,8 @@ set_common_sockopts(int s, const struct
errx(1, "can't set IPv6 min hop count (unavailable)");
#endif
}
+ if(uflag)
+ enable_icmp_errors(af,s);
}
int

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Dec 15 13:15:37 UTC 2020 - Cristian Rodríguez <crrodriguez@opensuse.org>
- Build with hidden visibility since no symbols should be exported
-------------------------------------------------------------------
Tue Dec 15 13:05:05 UTC 2020 - Cristian Rodríguez <crrodriguez@opensuse.org>
- enable-udp-ip_recverr.patch: Enable IP_RECVERR on UDP sockets
to match *bsd behaviour and avoid long timeouts if an error
ocurrs.
-------------------------------------------------------------------
Mon Dec 7 13:09:09 UTC 2020 - Cristian Rodríguez <crrodriguez@opensuse.org>

View File

@ -40,6 +40,7 @@ Patch11: destination-port-list.patch
Patch12: use-flags-to-specify-listen-address.patch
Patch13: misc-failures-and-features.patch
Patch14: port-select-on-connect.patch
Patch15: enable-udp-ip_recverr.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libbsd)
Provides: nc6 = %{version}
@ -65,7 +66,7 @@ for IPv6, proxies, and Unix sockets.
%build
make %{?_smp_mflags} \
CFLAGS="%{optflags}"
CFLAGS="%{optflags} -fvisibility=hidden"
%install
install -D -m0755 nc %{buildroot}%{_bindir}/nc