Compare commits
10 Commits
50981c01e3
...
cefbe930be
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cefbe930be | ||
|
|
0b4fc8e9bd | ||
|
|
cfc169b5e1 | ||
|
|
ed46cf51b5 | ||
|
|
25fa482107 | ||
|
|
8978ab5ada | ||
|
|
0ef8c184c4 | ||
|
|
66362a848c | ||
|
|
d952bf6e53 | ||
|
|
6187474e81 |
@ -0,0 +1,46 @@
|
||||
From 20a78e06a69bd9b6b4e15468201d5d3aa9c395db Mon Sep 17 00:00:00 2001
|
||||
From: Zach van Rijn <me@zv.io>
|
||||
Date: Wed, 21 Jun 2023 16:50:30 +0000
|
||||
Subject: [PATCH] Revert "sscanf pattern is %Lu not %llu for long long unsigned
|
||||
byte counters."
|
||||
|
||||
This reverts commit 811cf0aaf40a0e7f426f8ffaea7c3ca4b8bebdfc.
|
||||
|
||||
See also:
|
||||
* https://sourceforge.net/p/net-tools/mailman/message/37860727/
|
||||
* https://git.adelielinux.org/adelie/packages/-/issues/600
|
||||
---
|
||||
lib/interface.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/interface.c b/lib/interface.c
|
||||
index ef28dec..71d4163 100644
|
||||
--- a/lib/interface.c
|
||||
+++ b/lib/interface.c
|
||||
@@ -254,7 +254,7 @@ static int get_dev_fields(const char *bp, struct interface *ife)
|
||||
switch (procnetdev_vsn) {
|
||||
case 3:
|
||||
sscanf(bp,
|
||||
- "%Lu %Lu %lu %lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu %lu",
|
||||
+ "%llu %llu %lu %lu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu %lu",
|
||||
&ife->stats.rx_bytes,
|
||||
&ife->stats.rx_packets,
|
||||
&ife->stats.rx_errors,
|
||||
@@ -274,7 +274,7 @@ static int get_dev_fields(const char *bp, struct interface *ife)
|
||||
&ife->stats.tx_compressed);
|
||||
break;
|
||||
case 2:
|
||||
- sscanf(bp, "%Lu %Lu %lu %lu %lu %lu %Lu %Lu %lu %lu %lu %lu %lu",
|
||||
+ sscanf(bp, "%llu %llu %lu %lu %lu %lu %llu %llu %lu %lu %lu %lu %lu",
|
||||
&ife->stats.rx_bytes,
|
||||
&ife->stats.rx_packets,
|
||||
&ife->stats.rx_errors,
|
||||
@@ -292,7 +292,7 @@ static int get_dev_fields(const char *bp, struct interface *ife)
|
||||
ife->stats.rx_multicast = 0;
|
||||
break;
|
||||
case 1:
|
||||
- sscanf(bp, "%Lu %lu %lu %lu %lu %Lu %lu %lu %lu %lu %lu",
|
||||
+ sscanf(bp, "%llu %lu %lu %lu %lu %llu %lu %lu %lu %lu %lu",
|
||||
&ife->stats.rx_packets,
|
||||
&ife->stats.rx_errors,
|
||||
&ife->stats.rx_dropped,
|
||||
@ -156,10 +156,10 @@ diff -up net-tools-2.0/Makefile.interfaces net-tools-2.0/Makefile
|
||||
+++ net-tools-2.0/Makefile 2015-09-15 18:04:06.273668275 +0200
|
||||
@@ -193,6 +193,9 @@ ipmaddr: $(NET_LIB) ipmaddr.o
|
||||
mii-tool: $(NET_LIB) mii-tool.o
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB)
|
||||
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ mii-tool.o $(NLIB) $(LDLIBS)
|
||||
|
||||
+ether-wake: $(NET_LIB) ether-wake.o
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o ether-wake ether-wake.o $(NLIB)
|
||||
+ $(CC) $(CFLAGS) $(LDFLAGS) -o ether-wake ether-wake.o $(NLIB) $(LDLIBS)
|
||||
+
|
||||
installbin:
|
||||
@echo
|
||||
@ -0,0 +1,30 @@
|
||||
From 4030929bb6f3ee6f465c76869d7a49424df45d9e Mon Sep 17 00:00:00 2001
|
||||
From: Mike Frysinger <vapier@gentoo.org>
|
||||
Date: Sun, 12 Dec 2021 12:05:42 -0500
|
||||
Subject: [PATCH] interface: change pointopoint short flag from P to p
|
||||
|
||||
The P short flag was used by IFF_POINTOPOINT and IFF_PROMISC. Change
|
||||
IFF_POINTOPOINT to use p to avoid confusion, and because IFF_PROMISC
|
||||
is probably more common for people to check.
|
||||
|
||||
URL: https://sourceforge.net/p/net-tools/bugs/45
|
||||
---
|
||||
lib/interface.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/interface.c b/lib/interface.c
|
||||
index 4c33325..ef28dec 100644
|
||||
--- a/lib/interface.c
|
||||
+++ b/lib/interface.c
|
||||
@@ -693,7 +693,7 @@ void ife_print_short(struct interface *ptr)
|
||||
if (ptr->flags & IFF_NOARP)
|
||||
printf("O");
|
||||
if (ptr->flags & IFF_POINTOPOINT)
|
||||
- printf("P");
|
||||
+ printf("p");
|
||||
if (ptr->flags & IFF_SLAVE)
|
||||
printf("s");
|
||||
if (ptr->flags & IFF_MASTER)
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
diff -up net-tools-2.0/lib/interface.c.cycle net-tools-2.0/lib/interface.c
|
||||
--- net-tools-2.0/lib/interface.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.0/lib/interface.c 2016-03-30 09:58:18.247891588 +0200
|
||||
diff -up net-tools-2.10/lib/interface.c.cycle net-tools-2.10/lib/interface.c
|
||||
--- net-tools-2.10/lib/interface.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.10/lib/interface.c 2016-03-30 09:58:18.247891588 +0200
|
||||
@@ -93,6 +93,7 @@ int if_list_all = 0; /* do we have reque
|
||||
static struct interface *int_list, *int_last;
|
||||
|
||||
@ -161,9 +161,9 @@ diff -up net-tools-2.0/lib/interface.c.cycle net-tools-2.0/lib/interface.c
|
||||
fclose(fh);
|
||||
return err;
|
||||
}
|
||||
diff -up net-tools-2.0/man/en_US/netstat.8.cycle net-tools-2.0/man/en_US/netstat.8
|
||||
--- net-tools-2.0/man/en_US/netstat.8.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.0/man/en_US/netstat.8 2016-03-30 09:58:18.241891637 +0200
|
||||
diff -up net-tools-2.10/man/en_US/netstat.8.cycle net-tools-2.10/man/en_US/netstat.8
|
||||
--- net-tools-2.10/man/en_US/netstat.8.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.10/man/en_US/netstat.8 2016-03-30 09:58:18.241891637 +0200
|
||||
@@ -36,6 +36,7 @@ netstat \- Print network connections, ro
|
||||
.RB [ \-\-verbose | \-v ]
|
||||
.RB [ \-\-continuous | \-c]
|
||||
@ -247,9 +247,9 @@ diff -up net-tools-2.0/man/en_US/netstat.8.cycle net-tools-2.0/man/en_US/netstat
|
||||
.P
|
||||
.SH OUTPUT
|
||||
.P
|
||||
diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
--- net-tools-2.0/netstat.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.0/netstat.c 2016-03-30 10:04:07.617171984 +0200
|
||||
diff -up net-tools-2.10/netstat.c.cycle net-tools-2.10/netstat.c
|
||||
--- net-tools-2.10/netstat.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.10/netstat.c 2016-03-30 10:04:07.617171984 +0200
|
||||
@@ -115,8 +115,8 @@
|
||||
#endif
|
||||
|
||||
@ -431,9 +431,9 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
}
|
||||
if (flag_exp < 2) {
|
||||
ife_short = 1;
|
||||
- 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(!(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 (for_all_interfaces(do_if_print, &flag_all) < 0) {
|
||||
@ -458,17 +458,17 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
}
|
||||
|
||||
@@ -1915,9 +2045,10 @@ static void usage(int rc)
|
||||
{
|
||||
fprintf(stderr, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
|
||||
fprintf(stderr, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
|
||||
- fprintf(stderr, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
|
||||
+ fprintf(stderr, _(" netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
|
||||
FILE *fp = rc ? stderr : stdout;
|
||||
fprintf(fp, _("usage: netstat [-vWeenNcCF] [<Af>] -r netstat {-V|--version|-h|--help}\n"));
|
||||
fprintf(fp, _(" netstat [-vWnNcaeol] [<Socket> ...]\n"));
|
||||
- fprintf(fp, _(" netstat { [-vWeenNac] -i | [-cnNe] -M | -s [-6tuw] }\n\n"));
|
||||
+ fprintf(fp, _(" netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]\n\n"));
|
||||
|
||||
fprintf(stderr, _(" -r, --route display routing table\n"));
|
||||
+ fprintf(stderr, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
|
||||
fprintf(stderr, _(" -i, --interfaces display interface table\n"));
|
||||
fprintf(stderr, _(" -g, --groups display multicast group memberships\n"));
|
||||
fprintf(stderr, _(" -s, --statistics display networking statistics (like SNMP)\n"));
|
||||
fprintf(fp, _(" -r, --route display routing table\n"));
|
||||
+ fprintf(fp, _(" -I, --interfaces=<Iface> display interface table for <Iface>\n"));
|
||||
fprintf(fp, _(" -i, --interfaces display interface table\n"));
|
||||
fprintf(fp, _(" -g, --groups display multicast group memberships\n"));
|
||||
fprintf(fp, _(" -s, --statistics display networking statistics (like SNMP)\n"));
|
||||
@@ -1957,11 +2088,12 @@ int main
|
||||
(int argc, char *argv[]) {
|
||||
int i;
|
||||
@ -528,7 +528,7 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
}
|
||||
#else
|
||||
ENOSUPP("netstat", "FW_MASQUERADE");
|
||||
@@ -2182,15 +2327,16 @@ int main
|
||||
@@ -2182,16 +2327,17 @@ int main
|
||||
if (!afname[0])
|
||||
safe_strncpy(afname, DFLT_AF, sizeof(afname));
|
||||
|
||||
@ -539,6 +539,7 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
+ i = parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp);
|
||||
#else
|
||||
ENOSUPP("netstat", "AF INET");
|
||||
exit(1);
|
||||
#endif
|
||||
} else if(!strcmp(afname, "inet6")) {
|
||||
#if HAVE_AFINET6
|
||||
@ -546,7 +547,7 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
+ i = parsesnmp6(flag_raw, flag_tcp, flag_udp);
|
||||
#else
|
||||
ENOSUPP("netstat", "AF INET6");
|
||||
#endif
|
||||
exit(1);
|
||||
@@ -2198,7 +2344,11 @@ int main
|
||||
printf(_("netstat: No statistics support for specified address family: %s\n"), afname);
|
||||
exit(1);
|
||||
@ -589,9 +590,9 @@ diff -up net-tools-2.0/netstat.c.cycle net-tools-2.0/netstat.c
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
diff -up net-tools-2.0/statistics.c.cycle net-tools-2.0/statistics.c
|
||||
--- net-tools-2.0/statistics.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.0/statistics.c 2016-03-30 09:58:18.238891661 +0200
|
||||
diff -up net-tools-2.10/statistics.c.cycle net-tools-2.10/statistics.c
|
||||
--- net-tools-2.10/statistics.c.cycle 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.10/statistics.c 2016-03-30 09:58:18.238891661 +0200
|
||||
@@ -527,7 +527,7 @@ static void process_fd2(FILE *f, const c
|
||||
}
|
||||
}
|
||||
@ -12,24 +12,27 @@ diff -up net-tools-2.0/man/en_US/arp.8.man net-tools-2.0/man/en_US/arp.8
|
||||
.SH DESCRIPTION
|
||||
.B Arp
|
||||
manipulates or displays the kernel's IPv4 network neighbour cache. It can add
|
||||
@@ -219,6 +223,6 @@ published proxy ARP entries and permanen
|
||||
.br
|
||||
@@ -219,9 +223,6 @@ published proxy ARP entries and permanen
|
||||
.I /etc/ethers
|
||||
.SH SEE ALSO
|
||||
-rarp(8), route(8), ifconfig(8), netstat(8)
|
||||
+.BR ip(8)
|
||||
.BR ethers (5),
|
||||
-.BR rarp (8),
|
||||
-.BR route (8),
|
||||
-.BR ifconfig (8),
|
||||
-.BR netstat (8)
|
||||
+.BR ip (8)
|
||||
.SH AUTHORS
|
||||
Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>, Bernd Eckenfels <net\-tools@lina.inka.de>.
|
||||
diff -up net-tools-2.0/man/en_US/ethers.5.man net-tools-2.0/man/en_US/ethers.5
|
||||
--- net-tools-2.0/man/en_US/ethers.5.man 2014-04-26 02:45:16.000000000 +0200
|
||||
+++ net-tools-2.0/man/en_US/ethers.5 2014-07-07 14:51:31.378459439 +0200
|
||||
@@ -26,6 +26,3 @@ can be resolved by DNS or a dot separate
|
||||
.SH FILES \"{{{
|
||||
08:00:20:00:61:CA pal
|
||||
.SH FILES
|
||||
/etc/ethers
|
||||
.\"}}}
|
||||
-.SH "SEE ALSO" \"{{{
|
||||
-rarp(8)
|
||||
-.\"}}}
|
||||
-.SH "SEE ALSO"
|
||||
-.BR arp (8),
|
||||
-.BR rarp (8)
|
||||
diff -up net-tools-2.0/man/en_US/ifconfig.8.man net-tools-2.0/man/en_US/ifconfig.8
|
||||
--- net-tools-2.0/man/en_US/ifconfig.8.man 2014-04-26 02:45:16.000000000 +0200
|
||||
+++ net-tools-2.0/man/en_US/ifconfig.8 2014-07-07 14:51:31.379459422 +0200
|
||||
@ -47,13 +50,19 @@ diff -up net-tools-2.0/man/en_US/ifconfig.8.man net-tools-2.0/man/en_US/ifconfig
|
||||
.SH DESCRIPTION
|
||||
.B Ifconfig
|
||||
is used to configure the kernel-resident network interfaces. It is
|
||||
@@ -222,7 +229,8 @@ package to display link layer informatio
|
||||
@@ -222,13 +229,8 @@ package to display link layer informatio
|
||||
While appletalk DDP and IPX addresses will be displayed they cannot be
|
||||
altered by this command.
|
||||
.SH SEE ALSO
|
||||
-route(8), netstat(8), arp(8), rarp(8), iptables(8), ifup(8), interfaces(5).
|
||||
+.BR ip(8),
|
||||
+.BR iptables(8)
|
||||
-.BR route (8),
|
||||
-.BR netstat (8),
|
||||
-.BR arp (8),
|
||||
-.BR rarp (8),
|
||||
-.BR iptables (8),
|
||||
-.BR ifup (8),
|
||||
-.BR interfaces (5)
|
||||
+.BR ip (8),
|
||||
+.BR iptables (8)
|
||||
.br
|
||||
http://physics.nist.gov/cuu/Units/binary.html - Prefixes for binary multiples
|
||||
.SH AUTHORS
|
||||
@ -123,14 +132,16 @@ diff -up net-tools-2.0/man/en_US/route.8.man net-tools-2.0/man/en_US/route.8
|
||||
.SH DESCRIPTION
|
||||
.B Route
|
||||
manipulates the kernel's IP routing tables. Its primary use is to set
|
||||
@@ -330,10 +335,6 @@ Whether or not the hardware address for
|
||||
.I /proc/net/rt_cache
|
||||
@@ -330,11 +335,6 @@ Whether or not the hardware address for
|
||||
.LP
|
||||
.SH "SEE ALSO"
|
||||
-.IR ifconfig (8),
|
||||
-.IR netstat (8),
|
||||
-.IR arp (8),
|
||||
-.IR rarp (8),
|
||||
.IR ip (8)
|
||||
.BR ethers (5),
|
||||
-.BR arp (8),
|
||||
-.BR rarp (8),
|
||||
-.BR route (8),
|
||||
-.BR ifconfig (8),
|
||||
-.BR netstat (8)
|
||||
.LP
|
||||
.SH HISTORY
|
||||
.B Route
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
From bf7cc74cd048bfd9d1fb9474e94a915cc9e86fdb Mon Sep 17 00:00:00 2001
|
||||
From: eaglegai <eaglegai@163.com>
|
||||
Date: Fri, 2 Dec 2022 09:47:06 +0800
|
||||
Subject: [PATCH] fix ifconfig display error when the length of interface name is 15
|
||||
|
||||
Signed-off-by: eaglegai <eaglegai@163.com>
|
||||
---
|
||||
lib/interface.c | 6 ++++--
|
||||
1 file changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/interface.c b/lib/interface.c
|
||||
index baa9a9a..f321340 100644
|
||||
--- a/lib/interface.c
|
||||
+++ b/lib/interface.c
|
||||
@@ -248,8 +248,10 @@ static const char *get_name(char **namep, const char *p)
|
||||
}
|
||||
*name++ = *p++;
|
||||
count++;
|
||||
- if (count == (IFNAMSIZ-1))
|
||||
+ if (count == (IFNAMSIZ-1)) {
|
||||
+ p++;
|
||||
break;
|
||||
+ }
|
||||
}
|
||||
*name++ = '\0';
|
||||
return p;
|
||||
--
|
||||
2.33.0
|
||||
Binary file not shown.
BIN
net-tools-2.10.tar.xz
Normal file
BIN
net-tools-2.10.tar.xz
Normal file
Binary file not shown.
@ -1,34 +0,0 @@
|
||||
diff --git a/lib/interface.c.old b/lib/interface.c
|
||||
index c734c83..9c49a03 100644
|
||||
--- a/lib/interface.c.old
|
||||
+++ b/lib/interface.c
|
||||
@@ -928,10 +928,10 @@ void ife_print_long(struct interface *ptr)
|
||||
*/
|
||||
rx = ptr->stats.rx_bytes;
|
||||
short_rx = rx * 10;
|
||||
- if (rx > 1125899906842624ull) {
|
||||
- if (rx > (9223372036854775807ull / 10))
|
||||
- short_rx = rx / 112589990684262ull;
|
||||
- else
|
||||
+ if (rx > 1152921504606846976ull) {
|
||||
+ short_rx = rx / 115292150460684697ull;
|
||||
+ Rext = "EiB";
|
||||
+ } else if (rx > 1125899906842624ull) {
|
||||
short_rx /= 1125899906842624ull;
|
||||
Rext = "PiB";
|
||||
} else if (rx > 1099511627776ull) {
|
||||
@@ -949,10 +949,10 @@ void ife_print_long(struct interface *ptr)
|
||||
}
|
||||
tx = ptr->stats.tx_bytes;
|
||||
short_tx = tx * 10;
|
||||
- if (tx > 1125899906842624ull) {
|
||||
- if (tx > (9223372036854775807ull / 10))
|
||||
- short_tx = tx / 112589990684262ull;
|
||||
- else
|
||||
+ if (tx > 1152921504606846976ull) {
|
||||
+ short_tx = tx / 115292150460684697ull;
|
||||
+ Text = "EiB";
|
||||
+ } else if (tx > 1125899906842624ull) {
|
||||
short_tx /= 1125899906842624ull;
|
||||
Text = "PiB";
|
||||
} else if (tx > 1099511627776ull) {
|
||||
@ -1,59 +0,0 @@
|
||||
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) {
|
||||
@ -1,12 +0,0 @@
|
||||
diff -up net-tools-2.0/iptunnel.c.linux48 net-tools-2.0/iptunnel.c
|
||||
--- net-tools-2.0/iptunnel.c.linux48 2016-02-15 16:54:18.000000000 +0100
|
||||
+++ net-tools-2.0/iptunnel.c 2016-10-12 09:16:57.429279406 +0200
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <netinet/in.h>
|
||||
-#include <netinet/ip.h>
|
||||
+#include <linux/ip.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
@ -1,43 +0,0 @@
|
||||
diff --git a/man/en_US/netstat.8.old b/man/en_US/netstat.8
|
||||
index f22c2c5..d78a54a 100644
|
||||
--- a/man/en_US/netstat.8.old
|
||||
+++ b/man/en_US/netstat.8
|
||||
@@ -311,7 +311,37 @@ causes this column to be included. You will also need
|
||||
privileges to see this information on sockets you don't own. This
|
||||
identification information is not yet available for IPX sockets.
|
||||
.SS "Timer"
|
||||
-(this needs to be written)
|
||||
+TCP timer associated with this socket. The format is timer(a/b/c). The timer is one of the following values:
|
||||
+.TP
|
||||
+.I
|
||||
+off
|
||||
+There is no timer set for this socket.
|
||||
+.TP
|
||||
+.I
|
||||
+on
|
||||
+The retransmission timer is active for the socket.
|
||||
+.TP
|
||||
+.I
|
||||
+keepalive
|
||||
+The keepalive timer is active for the socket.
|
||||
+.TP
|
||||
+.I
|
||||
+timewait
|
||||
+The connection is closing and the timewait timer is active for the socket.
|
||||
+.P
|
||||
+The values in the brackets:
|
||||
+.TP
|
||||
+.I
|
||||
+a
|
||||
+Timer value.
|
||||
+.TP
|
||||
+.I
|
||||
+b
|
||||
+Number of retransmissions sent.
|
||||
+.TP
|
||||
+.I
|
||||
+c
|
||||
+Number of keepalives sent.
|
||||
.P
|
||||
.SS Active UNIX domain Sockets
|
||||
.SS "Proto"
|
||||
@ -1,10 +1,10 @@
|
||||
Name: net-tools
|
||||
Version: 2.0
|
||||
Release: 0.55
|
||||
Version: 2.10
|
||||
Release: 5
|
||||
Summary: Important Programs for Networking
|
||||
License: GPLv2+
|
||||
URL: https://sourceforge.net/projects/net-tools/
|
||||
Source0: net-tools-115f1af2494ded1fcd21c8419d5e289bc4df380f.tar.xz
|
||||
source0: https://sourceforge.net/projects/net-tools/files/%{name}-%{version}.tar.xz
|
||||
Source1: net-tools-config.h
|
||||
Source2: net-tools-config.make
|
||||
Source3: ether-wake.c
|
||||
@ -15,13 +15,12 @@ Source7: iptunnel.8
|
||||
Source8: ipmaddr.8
|
||||
Source9: arp-ethers.service
|
||||
|
||||
Patch1: net-tools-cycle.patch
|
||||
Patch2: net-tools-man.patch
|
||||
Patch3: net-tools-linux48.patch
|
||||
Patch20: ether-wake-interfaces.patch
|
||||
Patch21: net-tools-ifconfig-EiB.patch
|
||||
Patch22: net-tools-timer-man.patch
|
||||
Patch23: net-tools-interface-name-len.patch
|
||||
Patch1: backport-net-tools-cycle.patch
|
||||
Patch2: backport-net-tools-man.patch
|
||||
Patch3: backport-ether-wake-interfaces.patch
|
||||
Patch4: backport-interface-change-pointopoint-short-flag-from-P-to-p.patch
|
||||
Patch5: fix-ifconfig-display-error-when-the-length-of-interface-name-is-15.patch
|
||||
Patch6: backport-Revert-sscanf-pattern-is-Lu-not-llu-for-long-long-unsigned.patch
|
||||
|
||||
BuildRequires: bluez-libs-devel gettext, libselinux libselinux-devel systemd gcc
|
||||
%{?systemd_requires}
|
||||
@ -35,7 +34,7 @@ and have been moved to net-tools-deprecated.
|
||||
%package_help
|
||||
|
||||
%prep
|
||||
%setup -q -c
|
||||
%setup -q
|
||||
cp %SOURCE1 ./config.h
|
||||
cp %SOURCE2 ./config.make
|
||||
cp %SOURCE3 .
|
||||
@ -46,11 +45,10 @@ cp %SOURCE7 ./man/en_US
|
||||
cp %SOURCE8 ./man/en_US
|
||||
%patch1 -p1 -b .cycle
|
||||
%patch2 -p1 -b .man
|
||||
%patch3 -p1 -b .linux48
|
||||
%patch20 -p1 -b .interfaces
|
||||
%patch21 -p1 -b .ifconfig-EiB
|
||||
%patch22 -p1 -b .timer-man
|
||||
%patch23 -p1 -b .interface-name-len
|
||||
%patch3 -p1 -b .interfaces
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
touch ./config.h
|
||||
|
||||
%build
|
||||
@ -58,7 +56,7 @@ export CFLAGS="${RPM_OPT_FLAGS} -fpie"
|
||||
export LDFLAGS="${RPM_LD_FLAGS} -pie -Wl,-z,now"
|
||||
make
|
||||
make ether-wake
|
||||
gcc ${RPM_OPT_FLAGS} ${RPM_LD_FLAGS} -o mii-diag mii-diag.c
|
||||
%{__cc} ${RPM_OPT_FLAGS} ${RPM_LD_FLAGS} -o mii-diag mii-diag.c
|
||||
|
||||
%install
|
||||
mv man/de_DE man/de
|
||||
@ -111,7 +109,37 @@ touch %{buildroot}%{_unitdir}/arp-ethers.service
|
||||
%exclude %{_mandir}/pt/man5
|
||||
|
||||
%changelog
|
||||
*Wed Sep 2 2020 zengwefeng<zwfeng@huawei.com> - 2.0-0.55
|
||||
* Tue Apr 08 2025 gaihuiying <eaglegai@163.com> - 2.10-5
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:backport to use llu instead of Lu for unsigned long long type
|
||||
|
||||
* Thu Feb 22 2024 luofng <luofeng13@huawei.com> - 2.10-4
|
||||
- Type: enhencement
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:support for building with clang
|
||||
|
||||
* Mon Dec 19 2022 eaglegai <eaglegai@163.com> - 2.10-3
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix ifconfig display error when the length of interface name is 15
|
||||
|
||||
* Thu Oct 20 2022 konglidong <konglidong@uniontech.com> - 2.10-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:interface: change pointopoint short flag from P to p
|
||||
|
||||
* Tue Dec 07 2021 gaihuiying<gaihuiying1@huawei.com> - 2.10-1
|
||||
- Type:requirement
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:update net-tools to 2.10
|
||||
|
||||
* Wed Sep 2 2020 zengwefeng<zwfeng@huawei.com> - 2.0-0.55
|
||||
- Type:NA
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user