Browse Source

lksctp-tools package update

Signed-off-by: basebuilder_pel7x64builder0 <basebuilder@powerel.org>
master
basebuilder_pel7x64builder0 7 years ago
parent
commit
3c2d93e56f
  1. 117
      SOURCES/lksctp-tools-1.0.17-sctp_status-fix-hostname-resolution.patch
  2. 11
      SOURCES/lksctp-tools-1.0.6-libdir.patch
  3. 221
      SPECS/lksctp-tools.spec

117
SOURCES/lksctp-tools-1.0.17-sctp_status-fix-hostname-resolution.patch

@ -0,0 +1,117 @@ @@ -0,0 +1,117 @@
From 18272a1f3cf8c3fe287c1bf8a007d0ef4de4cf2f Mon Sep 17 00:00:00 2001
Message-Id: <18272a1f3cf8c3fe287c1bf8a007d0ef4de4cf2f.1467043686.git.marcelo.leitner@gmail.com>
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Date: Thu, 23 Jun 2016 18:27:26 -0300
Subject: [PATCH] sctp_status: fix hostname resolution

getaddrinfo already returns the IP address in binary format for the
given hostname/IP address, so there is no need to use inet_pton()
afterwards.

Such usage, actually, was causing localhost6 to be evaluated as ::.

Also, fix a leak on getaddrinfo results.

Signed-off-by: Marcelo R. Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
---
src/apps/sctp_status.c | 38 +++++++++++++++++++++++---------------
1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/src/apps/sctp_status.c b/src/apps/sctp_status.c
index 5bb48efc18074cb706112b10aa0d4a098954c3cd..46e9ca2af08ade626517a2d52bf0289d6be362e6 100644
--- a/src/apps/sctp_status.c
+++ b/src/apps/sctp_status.c
@@ -280,11 +280,12 @@ int main(int argc, char *argv[]) {
case AF_INET:
t_addr = (struct sockaddr_in *)&s_rem;
- t_addr->sin_family = AF_INET;
+ memcpy(t_addr, res->ai_addr,
+ res->ai_addrlen);
+ t_addr->sin_family = res->ai_family;
t_addr->sin_port = htons(remote_port);
- inet_pton(AF_INET, remote_host, &t_addr->sin_addr);
- r_len = sizeof (struct sockaddr_in);
+ r_len = res->ai_addrlen;
#ifdef __FreeBSD__
t_addr->sin_len = r_len;
#endif
@@ -292,13 +293,14 @@ int main(int argc, char *argv[]) {
case AF_INET6:
t_addr6 = (struct sockaddr_in6 *)&s_rem;
+ memcpy(t_addr6, res->ai_addr,
+ res->ai_addrlen);
+ t_addr6->sin6_family = res->ai_family;
+ t_addr6->sin6_port = htons(remote_port);
if (interface)
t_addr6->sin6_scope_id = if_nametoindex(interface);
- t_addr6->sin6_family = AF_INET6;
- t_addr6->sin6_port = htons(remote_port);
- inet_pton(AF_INET6, remote_host, &t_addr6->sin6_addr);
- r_len = sizeof (struct sockaddr_in6);
+ r_len = res->ai_addrlen;
#ifdef __FreeBSD__
t_addr6->sin6_len = r_len;
@@ -311,6 +313,8 @@ int main(int argc, char *argv[]) {
DEBUG_PRINT(DEBUG_MAX, "remote:addr=%s, port=%s, family=%d\n",
host_s, serv_s, res->ai_family);
+
+ freeaddrinfo(res);
}
if (local_host != NULL) {
@@ -342,11 +346,13 @@ int main(int argc, char *argv[]) {
switch (res->ai_family) {
case AF_INET:
t_addr = (struct sockaddr_in *)&s_loc;
- t_addr->sin_family = AF_INET;
+
+ memcpy(t_addr, res->ai_addr,
+ res->ai_addrlen);
+ t_addr->sin_family = res->ai_family;
t_addr->sin_port = htons(local_port);
- inet_pton(AF_INET, local_host, &t_addr->sin_addr);
- l_len = sizeof (struct sockaddr_in);
+ l_len = res->ai_addrlen;
#ifdef __FreeBSD__
t_addr->sin_len = l_len;
#endif
@@ -354,14 +360,14 @@ int main(int argc, char *argv[]) {
case AF_INET6:
t_addr6 = (struct sockaddr_in6 *)&s_loc;
+ memcpy(t_addr6, res->ai_addr,
+ res->ai_addrlen);
+ t_addr6->sin6_family = res->ai_family;
+ t_addr6->sin6_port = htons(local_port);
if (interface)
t_addr6->sin6_scope_id = if_nametoindex(interface);
- t_addr6->sin6_family = AF_INET6;
- t_addr6->sin6_port = htons(local_port);
- inet_pton(AF_INET6, local_host, &t_addr6->sin6_addr);
-
- l_len = sizeof (struct sockaddr_in6);
+ l_len = res->ai_addrlen;
#ifdef __FreeBSD__
t_addr6->sin6_len = l_len;
@@ -377,6 +383,8 @@ int main(int argc, char *argv[]) {
DEBUG_PRINT(DEBUG_MAX, "local:addr=%s, port=%s, family=%d\n",
host_s, serv_s, res->ai_family);
+
+ freeaddrinfo(res);
}
/* Let the testing begin. */
--
2.5.5

11
SOURCES/lksctp-tools-1.0.6-libdir.patch

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
diff -up lksctp-tools-1.0.11/src/withsctp/withsctp.in.orig lksctp-tools-1.0.11/src/withsctp/withsctp.in
--- lksctp-tools-1.0.11/src/withsctp/withsctp.in.orig 2009-10-24 02:49:15.000000000 +0200
+++ lksctp-tools-1.0.11/src/withsctp/withsctp.in 2009-12-01 13:46:30.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/sh
# -*- sh -*-
-LIBDIR=@libdir@/@PACKAGE@
+LIBDIR=`rpm --eval "%{_libdir}"`/@PACKAGE@
BINDIR=@bindir@
export LD_PRELOAD=${LIBDIR}/libwithsctp.so.1.0.17
if ! ${BINDIR}/checksctp 2> /dev/null

221
SPECS/lksctp-tools.spec

@ -0,0 +1,221 @@ @@ -0,0 +1,221 @@
Summary: User-space access to Linux Kernel SCTP
Name: lksctp-tools
Version: 1.0.17
Release: 2%{?dist}
# src/apps/bindx_test.C is GPLv2, I've asked upstream for clarification
License: GPLv2 and GPLv2+ and LGPLv2 and MIT
Group: System Environment/Libraries
URL: http://lksctp.sourceforge.net
Source0: http://downloads.sourceforge.net/lksctp/%{name}-%{version}.tar.gz
Patch0: lksctp-tools-1.0.6-libdir.patch
Patch1: lksctp-tools-1.0.17-sctp_status-fix-hostname-resolution.patch
BuildRequires: libtool, automake, autoconf

%description
This is the lksctp-tools package for Linux Kernel SCTP (Stream Control
Transmission Protocol) Reference Implementation.

This package is intended to supplement the Linux Kernel SCTP Reference
Implementation now available in the Linux kernel source tree in
versions 2.5.36 and following. For more information on LKSCTP see the
package documentation README file, section titled "LKSCTP - Linux
Kernel SCTP."

This package contains the base run-time library and command-line tools.

%package devel
Summary: Development files for lksctp-tools
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}

%description devel
Development files for lksctp-tools which include man pages, header files,
static libraries, symlinks to dynamic libraries and some tutorial source code.

%package doc
Summary: Documents pertaining to SCTP
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}

%description doc
Documents pertaining to LKSCTP & SCTP in general (IETF RFC's & Internet
Drafts).

%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build
[ ! -x ./configure ] && sh bootstrap
%configure --disable-static
# remove rpath from libtool
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make %{?_smp_mflags}

%install
rm -f doc/rfc2960.txt doc/states.txt
make install DESTDIR="$RPM_BUILD_ROOT" INSTALL="install -p"

find $RPM_BUILD_ROOT/%{_libdir}/ -name "*.la" | xargs rm -f

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING* README
%{_bindir}/*
%{_libdir}/libsctp.so.*
%dir %{_libdir}/lksctp-tools/
%{_libdir}/lksctp-tools/libwithsctp.so.*
%{_mandir}/man7/*

%files devel
%defattr(-,root,root,-)
%{_includedir}/*
%{_libdir}/libsctp.so
%{_libdir}/lksctp-tools/libwithsctp.so
%{_libdir}/pkgconfig/libsctp.pc
%{_datadir}/lksctp-tools/
%{_mandir}/man3/*

%files doc
%defattr(-,root,root,-)
%doc doc/*.txt

%changelog
* Mon Jun 27 2016 Marcelo Ricardo Leitner <mleitner@redhat.com> - 1.0.17-2
- Added patch fixing issue with sctp_status and DNS with IPv6 addresses.
[1349497]

* Tue May 10 2016 Marcelo Ricardo Leitner <mleitner@redhat.com> - 1.0.17-1
- Update to 1.0.17

* Wed Nov 18 2015 Marcelo Ricardo Leitner <mleitner@redhat.com> - 1.0.16-1
- Update to 1.0.16

* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 1.0.13-3
- Mass rebuild 2014-01-24

* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.0.13-2
- Mass rebuild 2013-12-27

* Fri Jan 25 2013 Daniel Borkmann <dborkman@redhat.com> - 1.0.13-1
- Update to 1.0.13

* Mon Jan 21 2013 Jan Safranek <jsafrane@redhat.com> - 1.0.12-1
- Update to 1.0.12

* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.11-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Tue Oct 05 2010 Parag Nemade <paragn AT fedoraproject.org> - 1.0.11-2
- Merge-review cleanup (#226100)

* Tue Dec 1 2009 Jan Safranek <jsafrane@redhat.com> 1.0.11-1
- Update to 1.0.11
- Remove rpath from compiled binaries
- Remove static libraries

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Tue Apr 14 2009 Zdenek Prikryl <zprikryl@redhat.com> 1.0.10-1
- added release tag to Requires of devel and doc packages (#492531)
- Update to 1.0.10

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Aug 06 2008 Zdenek Prikryl <zprikryl@redhat.com> 1.0.9-1
- Update to 1.0.9

* Wed Jul 16 2008 Zdenek Prikryl <zprikryl@redhat.com> 1.0.8-1
- Update to 1.0.8

* Wed Feb 20 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 1.0.7-3
- Autorebuild for GCC 4.3

* Wed Aug 29 2007 Karsten Hopp <karsten@redhat.com> 1.0.7-2
- rebuild for buildid

* Wed Aug 08 2007 Karsten Hopp <karsten@redhat.com> 1.0.7-1
- update to 1.0.7
- update license tag

* Wed Feb 21 2007 Karsten Hopp <karsten@redhat.com> 1.0.6-3
- add post/postun requirements
- review fixes

* Tue Sep 19 2006 Karsten Hopp <karsten@redhat.de> 1.0.6-2
- fix fileconflict (#205225)

* Tue Jul 25 2006 Karsten Hopp <karsten@redhat.de> 1.0.6-1
- update to 1.0.6

* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 1.0.5-1.fc5.2.1
- rebuild

* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 1.0.5-1.fc5.2
- bump again for double-long bug on ppc(64)

* Tue Feb 07 2006 Jesse Keating <jkeating@redhat.com> - 1.0.5-1.fc5.1
- rebuilt for new gcc4.1 snapshot and glibc changes

* Tue Jan 24 2006 Warren Togami <wtogami@redhat.com> 1.0.5-1
- 1.0.5

* Fri Nov 11 2005 Matthias Saou <http://freshrpms.net/> 1.0.4-1
- Update to 1.0.4.
- Update syntax patch.
- Execute bootstrap if no configure script is found.
- Don't own entire man? directories.
- Own data and lib lksctp-tools directories.
- Move devel libs in _libdir/lksctp-tools/ to devel package.
- Exclude .la files.
- Minor spec file cleanups.

* Wed Mar 02 2005 Karsten Hopp <karsten@redhat.de> 1.0.2-5
- build with gcc-4

* Mon Feb 07 2005 Karsten Hopp <karsten@redhat.de> 1.0.2-4
- initialize variable before use
- fix subscript out of range bug (#147286)

* Mon Jan 24 2005 Karsten Hopp <karsten@redhat.de> 1.0.2-3
- build for FC

* Mon Jan 24 2005 Karsten Hopp <karsten@redhat.de> 1.0.2-2.40E.1
- initial RH version based on sourceforge rpm

* Thu Dec 30 2004 Sridhar Samudrala <sri@us.ibm.com> 1.0.2-1
- 1.0.2 Release

* Tue May 11 2004 Sridhar Samudrala <sri@us.ibm.com> 1.0.1-1
- 1.0.1 Release

* Thu Feb 26 2004 Sridhar Samudrala <sri@us.ibm.com> 1.0.0-1
- 1.0.0 Release

* Fri Feb 6 2004 Francois-Xavier Kowalski <francois-xavier.kowalski@hp.com> 0.9.0-1
- package only .txt doc files

* Wed Feb 4 2004 Francois-Xavier Kowalski <francois-xavier.kowalski@hp.com> 0.7.5-1
- badly placed & undelivered files
- simplified delivery list

* Tue Jan 27 2004 Francois-Xavier Kowalski <francois-xavier.kowalski@hp.com> 0.7.5-1
- Integrate comment from project team

* Sat Jan 10 2004 Francois-Xavier Kowalski <francois-xavier.kowalski@hp.com> 2.6.0_test7_0.7.4-1
- Creation
Loading…
Cancel
Save