Improve scanf-format.patch (#668047)

This commit is contained in:
Jiri Popelka 2011-02-04 15:00:36 +01:00
parent a03b4bf68c
commit dc1ed7a6ed
2 changed files with 44 additions and 39 deletions

View File

@ -1,6 +1,6 @@
diff -up net-tools-1.60/arp.c.scanf-format net-tools-1.60/arp.c
--- net-tools-1.60/arp.c.scanf-format 2009-07-08 11:17:09.000000000 +0200
+++ net-tools-1.60/arp.c 2009-07-08 11:43:39.000000000 +0200
--- net-tools-1.60/arp.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/arp.c 2011-02-04 14:37:11.000000000 +0100
@@ -557,7 +557,7 @@ static int arp_show(char *name)
/* Read the ARP cache entries. */
for (num = 0; num < entries; num++) {
@ -10,24 +10,29 @@ diff -up net-tools-1.60/arp.c.scanf-format net-tools-1.60/arp.c
ip, &type, &flags, hwa, mask, dev) < 4)
break;
diff -up net-tools-1.60/lib/inet6_gr.c.scanf-format net-tools-1.60/lib/inet6_gr.c
--- net-tools-1.60/lib/inet6_gr.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/lib/inet6_gr.c 2011-02-04 14:39:54.000000000 +0100
@@ -78,7 +78,7 @@ int rprint_fib6(int ext, int numeric)
"Flags Metric Ref Use Iface\n"));
while (fgets(buff, 1023, fp)) {
- num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %s\n",
+ num = sscanf(buff, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %02x %4s%4s%4s%4s%4s%4s%4s%4s %08x %08x %08x %08x %15s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7],
&prefix_len,
diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c
--- net-tools-1.60/lib/inet_gr.c.scanf-format 2000-10-28 12:59:42.000000000 +0200
+++ net-tools-1.60/lib/inet_gr.c 2009-07-08 11:49:59.000000000 +0200
@@ -38,7 +38,7 @@ extern char *INET_sprintmask(struct sock
int rprint_fib(int ext, int numeric)
{
- char buff[1024], iface[16], flags[64];
+ char buff[1024], iface[17], flags[64];
char gate_addr[128], net_addr[128];
char mask_addr[128];
int num, iflags, metric, refcnt, use, mss, window, irtt;
@@ -69,18 +69,18 @@ int rprint_fib(int ext, int numeric)
+++ net-tools-1.60/lib/inet_gr.c 2011-02-04 14:55:41.000000000 +0100
@@ -68,19 +68,19 @@ int rprint_fib(int ext, int numeric)
mss = 0;
fmt = proc_gen_fmt(_PATH_PROCNET_ROUTE, 0, fp,
"Iface", "%16s",
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Flags", "%X",
@ -41,25 +46,18 @@ diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c
"IRTT", "%d",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d\n" */
+ /* "%16s %127s %127s %X %d %d %d %127s %d %d %d\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d\n" */
if (!fmt)
return 1;
@@ -205,7 +205,7 @@ int rprint_fib(int ext, int numeric)
int rprint_cache(int ext, int numeric)
{
- char buff[1024], iface[16], flags[64];
+ char buff[1024], iface[17], flags[64];
char gate_addr[128], dest_addr[128], specdst[128];
char src_addr[128];
struct sockaddr snet;
@@ -269,20 +269,20 @@ int rprint_cache(int ext, int numeric)
@@ -268,21 +268,21 @@ int rprint_cache(int ext, int numeric)
"MSS Window irtt HH Arp\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
"Iface", "%16s",
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Flags", "%X",
@ -75,16 +73,18 @@ diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c
"ARP", "%d",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d\n" */
+ /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d\n" */
}
if (format == 2) {
@@ -292,13 +292,13 @@ int rprint_cache(int ext, int numeric)
@@ -291,23 +291,23 @@ int rprint_cache(int ext, int numeric)
"Flags Metric Ref Use Iface "
"MSS Window irtt TOS HHRef HHUptod SpecDst\n"));
fmt = proc_gen_fmt(_PATH_PROCNET_RTCACHE, 0, fp,
"Iface", "%16s",
- "Iface", "%16s",
- "Destination", "%128s",
- "Gateway", "%128s",
+ "Iface", "%15s",
+ "Destination", "%127s",
+ "Gateway", "%127s",
"Flags", "%X",
@ -96,18 +96,20 @@ diff -up net-tools-1.60/lib/inet_gr.c.scanf-format net-tools-1.60/lib/inet_gr.c
"MTU", "%d",
"Window", "%d",
"IRTT", "%d",
@@ -307,7 +307,7 @@ int rprint_cache(int ext, int numeric)
"TOS", "%d",
"HHRef", "%d",
"HHUptod", "%d",
"SpecDst", "%128s",
- "SpecDst", "%128s",
+ "SpecDst", "%127s",
NULL);
- /* "%16s %128s %128s %X %d %d %d %128s %d %d %d %d %d %128s\n" */
+ /* "%16s %127s %127s %X %d %d %d %127s %d %d %d %d %d %128s\n" */
+ /* "%15s %127s %127s %X %d %d %d %127s %d %d %d %d %d %127s\n" */
}
diff -up net-tools-1.60/lib/interface.c.scanf-format net-tools-1.60/lib/interface.c
--- net-tools-1.60/lib/interface.c.scanf-format 2009-07-08 11:17:09.000000000 +0200
+++ net-tools-1.60/lib/interface.c 2009-07-08 11:45:44.000000000 +0200
--- net-tools-1.60/lib/interface.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/lib/interface.c 2011-02-04 14:37:11.000000000 +0100
@@ -713,7 +713,7 @@ void ife_print_long(struct interface *pt
#endif
#if HAVE_AFINET6
@ -118,9 +120,9 @@ diff -up net-tools-1.60/lib/interface.c.scanf-format net-tools-1.60/lib/interfac
int plen, scope, dad_status, if_idx;
extern struct aftype inet6_aftype;
diff -up net-tools-1.60/netstat.c.scanf-format net-tools-1.60/netstat.c
--- net-tools-1.60/netstat.c.scanf-format 2009-07-08 11:17:09.000000000 +0200
+++ net-tools-1.60/netstat.c 2009-07-08 11:42:12.000000000 +0200
@@ -1105,7 +1105,7 @@ static void udp_do_one(int lnr, const ch
--- net-tools-1.60/netstat.c.scanf-format 2011-02-04 14:37:11.000000000 +0100
+++ net-tools-1.60/netstat.c 2011-02-04 14:37:11.000000000 +0100
@@ -1103,7 +1103,7 @@ static void udp_do_one(int lnr, const ch
more[0] = '\0';
num = sscanf(line,
@ -129,7 +131,7 @@ diff -up net-tools-1.60/netstat.c.scanf-format net-tools-1.60/netstat.c
&d, local_addr, &local_port,
rem_addr, &rem_port, &state,
&txq, &rxq, &timer_run, &time_len, &retr, &uid, &timeout, &inode, more);
@@ -1540,7 +1540,7 @@ static void raw_do_one(int lnr, const ch
@@ -1536,7 +1536,7 @@ static void raw_do_one(int lnr, const ch
more[0] = '\0';
num = sscanf(line,

View File

@ -1,7 +1,7 @@
Summary: Basic networking tools
Name: net-tools
Version: 1.60
Release: 113%{?dist}
Release: 114%{?dist}
License: GPL+
Group: System Environment/Base
URL: http://net-tools.berlios.de/
@ -331,6 +331,9 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/ethers
%changelog
* Fri Feb 04 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-114
- Improve scanf-format.patch (#668047)
* Fri Jan 21 2011 Jiri Popelka <jpopelka@redhat.com> - 1.60-113
- Improve route(8) man page saying that 'route mss' actually sets MTU (#671321)