Browse Source

net-tools package update

Signed-off-by: basebuilder_pel7x64builder0 <basebuilder@powerel.org>
master
basebuilder_pel7x64builder0 6 years ago
parent
commit
0465196f8b
  1. 59
      SOURCES/net-tools-interface-name-len.patch
  2. 20
      SPECS/net-tools.spec

59
SOURCES/net-tools-interface-name-len.patch

@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
diff --git a/netstat.c b/netstat.c
index c084dfb..cfcfb78 100644
--- a/netstat.c
+++ b/netstat.c
@@ -743,6 +743,7 @@ static void igmp_do_one(int lnr, const char *line,const char *prot)
static int igmp6_flag = 0;
static char device[16];
int num, idx, refcnt;
+ char* offset;
if (lnr == 0) {
/* IPV6 ONLY */
@@ -794,17 +795,21 @@ static void igmp_do_one(int lnr, const char *line,const char *prot)
#if HAVE_AFINET
if (line[0] != '\t') {
if (idx_flag) {
- if ((num = sscanf( line, "%d\t%10c", &idx, device)) < 2) {
+ if ((num = sscanf( line, "%d\t%15c", &idx, device)) < 2) {
fprintf(stderr, _("warning, got bogus igmp line %d.\n"), lnr);
return;
}
} else {
- if ( (num = sscanf( line, "%10c", device )) < 1 ) {
+ if ( (num = sscanf( line, "%15c", device )) < 1 ) {
fprintf(stderr, _("warning, got bogus igmp line %d.\n"), lnr);
return;
}
}
- device[10] = '\0';
+
+ offset = strrchr(device, ':');
+ if(offset)
+ *offset = 0;
+
return;
} else if ( line[0] == '\t' ) {
if ( (num = sscanf(line, "\t%8[0-9A-Fa-f] %d", mcast_addr, &refcnt)) < 2 ) {
@@ -2037,7 +2037,7 @@ static int iface_info(void)
if (flag_exp < 2) {
ife_short = 1;
if(!(count % 8))
- printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
+ printf(_("Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
}

if (flag_int_name) {
diff --git a/lib/interface.c b/lib/interface.c
index 3bd999f..97f3db5 100644
--- a/lib/interface.c
+++ b/lib/interface.c
@@ -655,7 +655,7 @@ int do_if_print(struct interface *ife, void *cookie)
void ife_print_short(struct interface *ptr)
{
- printf("%-8.8s ", ptr->name);
+ printf("%-15.15s ", ptr->name);
printf("%5d ", ptr->mtu);
/* If needed, display the interface statistics. */
if (ptr->statistics_valid) {

20
SPECS/net-tools.spec

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
Summary: Basic networking tools
Name: net-tools
Version: 2.0
Release: 0.22.%{checkout}%{?dist}
Release: 0.24.%{checkout}%{?dist}
License: GPLv2+
Group: System Environment/Base
URL: http://sourceforge.net/projects/net-tools/
@ -65,6 +65,9 @@ Patch23: net-tools-ifconfig-EiB.patch @@ -65,6 +65,9 @@ Patch23: net-tools-ifconfig-EiB.patch
# sctp was not documented in help and manpage
Patch24: net-tools-netstat-sctp-man.patch

# output of interface names was restricted to 8-10 characters max
Patch25: net-tools-interface-name-len.patch

BuildRequires: gettext, libselinux
BuildRequires: libselinux-devel
BuildRequires: systemd-units
@ -102,6 +105,7 @@ cp %SOURCE8 ./man/en_US @@ -102,6 +105,7 @@ cp %SOURCE8 ./man/en_US
%patch22 -p1 -b .exit-code
%patch23 -p1 -b .round-EiB
%patch24 -p1 -b .sctp-man
%patch25 -p1 -b .interface-name-len

touch ./config.h

@ -178,16 +182,22 @@ install -m 644 %{SOURCE9} %{buildroot}%{_unitdir} @@ -178,16 +182,22 @@ install -m 644 %{SOURCE9} %{buildroot}%{_unitdir}
%attr(0644,root,root) %{_unitdir}/arp-ethers.service

%changelog
* Wed Mar 29 2017 Michal Ruprich - 2.0-0.22.20131004git
* Wed Apr 25 2018 Michal Ruprich <mruprich@redhat.com> - 2.0-0.24.20131004git
- Resolves: #1568306 - netstat -i only shows 8 characters of Iface name

* Tue Apr 10 2018 Michal Ruprich <mruprich@redhat.com> - 2.0-0.23.20131004git
- Resolves: #1538315 - netstat -agn only shows 10 character interface name for IPv4 addressing

* Wed Mar 29 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.22.20131004git
- Resolves: #1167833 - netstat -S/--sctp not documented

* Wed Mar 22 2017 Michal Ruprich - 2.0-0.21.20131004git
* Wed Mar 22 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.21.20131004git
- Related: #1427889 - exit code on wrong parameter is zero for many net-tools binaries

* Wed Mar 22 2017 Michal Ruprich - 2.0-0.20.20131004git
* Wed Mar 22 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.20.20131004git
- Resolves: #1427889 - exit code on wrong parameter is zero for many net-tools binaries

* Mon Feb 27 2017 Michal Ruprich - 2.0-0.19.20131004git
* Mon Feb 27 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.19.20131004git
- Related: #1257549 - netstat tool does not throw correct exit code on wrong parameter

* Wed Jan 18 2017 Michal Ruprich <mruprich@redhat.com> - 2.0-0.18.20131004git

Loading…
Cancel
Save