From 568266e188881467c52fd2df568e76f5a0554c5d801937a2a81efd14f236d74b Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Wed, 16 Dec 2020 08:36:19 +0000 Subject: [PATCH] Accepting request 855992 from home:elvigia:branches:network:utilities - Build with hidden visibility since no symbols should be exported - enable-udp-ip_recverr.patch: Enable IP_RECVERR on UDP sockets to match *bsd behaviour and avoid long timeouts if an error ocurrs. OBS-URL: https://build.opensuse.org/request/show/855992 OBS-URL: https://build.opensuse.org/package/show/network:utilities/netcat-openbsd?expand=0&rev=24 --- enable-udp-ip_recverr.patch | 35 +++++++++++++++++++++++++++++++++++ netcat-openbsd.changes | 12 ++++++++++++ netcat-openbsd.spec | 3 ++- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 enable-udp-ip_recverr.patch diff --git a/enable-udp-ip_recverr.patch b/enable-udp-ip_recverr.patch new file mode 100644 index 0000000..9e1cc4e --- /dev/null +++ b/enable-udp-ip_recverr.patch @@ -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 diff --git a/netcat-openbsd.changes b/netcat-openbsd.changes index f375c35..79d1499 100644 --- a/netcat-openbsd.changes +++ b/netcat-openbsd.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Dec 15 13:15:37 UTC 2020 - Cristian Rodríguez + +- Build with hidden visibility since no symbols should be exported + +------------------------------------------------------------------- +Tue Dec 15 13:05:05 UTC 2020 - Cristian Rodríguez + +- 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 diff --git a/netcat-openbsd.spec b/netcat-openbsd.spec index 766d00e..9cf9fbc 100644 --- a/netcat-openbsd.spec +++ b/netcat-openbsd.spec @@ -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