File net-tools-1.60-netstat-ci.diff of Package net-tools

--- net-tools-1.60/netstat.c	2008-09-10 08:32:10.000000000 +0000
+++ net-tools-1.60/netstat.c	2008-09-10 08:33:08.000000000 +0000
@@ -1922,8 +1922,6 @@
 	printf(_("Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR   TX-OK TX-ERR TX-DRP TX-OVR Flg\n"));
     }
 
-    get_max_ifacename();
-
     if (flag_cacheof == 1) {
     	if (for_all_interfaces(do_if_cache_print, &flag_all, flag_cacheof) < 0) {
 		perror(_("missing interface information"));
@@ -2203,6 +2201,7 @@
 	return (i);
     }
     if (flag_int) {
+	get_max_ifacename(flag_cacheof);
 	for (;;) {
 	    i = iface_info();
 	    if (!flag_cnt || i)
--- net-tools-1.60/lib/interface.c	2008-09-09 21:24:57.612332000 +0200
+++ net-tools-1.60/lib/interface.c	2008-09-09 21:27:23.843946000 +0200
@@ -140,12 +140,12 @@
     return 0;
 }
 
-void get_max_ifacename(void)
+void get_max_ifacename(int flag_cacheof)
 {
     struct interface *ife;
     int tmp = ife_field;
 
-    if (!int_list && (if_readlist(0) < 0)) {
+    if (!int_list && (if_readlist(flag_cacheof) < 0)) {
         return;
     }
     for (ife = int_list; ife; ife = ife->next) {
--- net-tools-1.60/include/interface.h	2008-09-09 21:25:12.272655000 +0200
+++ net-tools-1.60/include/interface.h	2008-09-09 21:27:48.718043000 +0200
@@ -64,6 +64,7 @@
 extern int if_fetch(struct interface *ife);
 
 extern int for_all_interfaces(int (*)(struct interface *, void *), void *, int);
+extern void get_max_ifacename(int flag_cacheof);
 extern int free_interface_list(void);
 extern struct interface *lookup_interface(char *name);
 extern int if_readlist(int);
openSUSE Build Service is sponsored by