~ubuntu-branches/debian/sid/net-tools/sid

« back to all changes in this revision

Viewing changes to debian/patches/lib_local_changes.patch

  • Committer: Package Import Robot
  • Author(s): Martín Ferrari
  • Date: 2015-09-07 01:54:07 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150907015407-v2tfsgxayjd3iq4i
Tags: 1.60+git20150829.73cef8a-1
* After 14 years without an upstream release, I am producing a new package
  based on today's upstream repository.
  Closes: #391495, #486448, #323261, #260587, #545328, #511395.
* Remove many patches now merged upstream, delete unmaintainable and
  undocumented local changes, and update the rest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Changes extracted from diff.gz, not present in upstream's CVS.
2
 
 
3
 
Index: net-tools/lib/ec_hw.c
4
 
===================================================================
5
 
--- net-tools.orig/lib/ec_hw.c
6
 
+++ net-tools/lib/ec_hw.c
7
 
@@ -16,6 +16,8 @@
8
 
 
9
 
 #if HAVE_HWEC
10
 
 
11
 
+#include <stddef.h>
12
 
+
13
 
 #include <net/if_arp.h>
14
 
 #include "net-support.h"
15
 
 
16
 
Index: net-tools/lib/fddi.c
17
 
===================================================================
18
 
--- net-tools.orig/lib/fddi.c
19
 
+++ net-tools/lib/fddi.c
20
 
@@ -26,6 +26,7 @@
21
 
 #error "No FDDI Support in your current Kernelsource Tree."
22
 
 #error "Disable HW Type FDDI"
23
 
 #endif
24
 
+#include <linux/types.h>
25
 
 #if __GLIBC__ >= 2
26
 
 #include <netinet/if_fddi.h>
27
 
 #else
28
 
Index: net-tools/lib/interface.c
29
 
===================================================================
30
 
--- net-tools.orig/lib/interface.c
31
 
+++ net-tools/lib/interface.c
32
 
@@ -594,7 +594,7 @@ int do_if_print(struct interface *ife, v
33
 
 
34
 
 void ife_print_short(struct interface *ptr)
35
 
 {
36
 
-    printf("%-5.5s ", ptr->name);
37
 
+    printf("%-9s ", ptr->name);
38
 
     printf("%5d %-2d ", ptr->mtu, ptr->metric);
39
 
     /* If needed, display the interface statistics. */
40
 
     if (ptr->statistics_valid) {
41
 
@@ -653,8 +653,7 @@ void ife_print_long(struct interface *pt
42
 
     unsigned long long rx, tx, short_rx, short_tx;
43
 
     const char *Rext = "B";
44
 
     const char *Text = "B";
45
 
-    static char flags[200];
46
 
-    
47
 
+
48
 
 #if HAVE_AFIPX
49
 
     static struct aftype *ipxtype = NULL;
50
 
 #endif
51
 
@@ -686,70 +685,32 @@ void ife_print_long(struct interface *pt
52
 
     if (hw == NULL)
53
 
        hw = get_hwntype(-1);
54
 
 
55
 
-    sprintf(flags, "flags=%d<", ptr->flags);
56
 
-    /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
57
 
-    if (ptr->flags == 0)
58
 
-       strcat(flags,">");
59
 
-    if (ptr->flags & IFF_UP)
60
 
-       strcat(flags,_("UP,"));
61
 
-    if (ptr->flags & IFF_BROADCAST)
62
 
-       strcat(flags,_("BROADCAST,"));
63
 
-    if (ptr->flags & IFF_DEBUG)
64
 
-       strcat(flags,_("DEBUG,"));
65
 
-    if (ptr->flags & IFF_LOOPBACK)
66
 
-       strcat(flags,_("LOOPBACK,"));
67
 
-    if (ptr->flags & IFF_POINTOPOINT)
68
 
-       strcat(flags,_("POINTOPOINT,"));
69
 
-    if (ptr->flags & IFF_NOTRAILERS)
70
 
-       strcat(flags,_("NOTRAILERS,"));
71
 
-    if (ptr->flags & IFF_RUNNING)
72
 
-       strcat(flags,_("RUNNING,"));
73
 
-    if (ptr->flags & IFF_NOARP)
74
 
-       strcat(flags,_("NOARP,"));
75
 
-    if (ptr->flags & IFF_PROMISC)
76
 
-       strcat(flags,_("PROMISC,"));
77
 
-    if (ptr->flags & IFF_ALLMULTI)
78
 
-       strcat(flags,_("ALLMULTI,"));
79
 
-    if (ptr->flags & IFF_SLAVE)
80
 
-       strcat(flags,_("SLAVE,"));
81
 
-    if (ptr->flags & IFF_MASTER)
82
 
-       strcat(flags,_("MASTER,"));
83
 
-    if (ptr->flags & IFF_MULTICAST)
84
 
-       strcat(flags,_("MULTICAST,"));
85
 
-#ifdef HAVE_DYNAMIC
86
 
-    if (ptr->flags & IFF_DYNAMIC)
87
 
-       strcat(flags,_("DYNAMIC,"));
88
 
-#endif
89
 
-    /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
90
 
-    if (flags[strlen(flags)-1] == ',')
91
 
-      flags[strlen(flags)-1] = '>';
92
 
-    else
93
 
-      flags[strlen(flags)-1] = 0;
94
 
-      
95
 
-
96
 
-    printf(_("%s: %s  mtu %d  metric %d"),
97
 
-          ptr->name, flags, ptr->mtu, ptr->metric ? ptr->metric : 1);
98
 
-#ifdef SIOCSKEEPALIVE
99
 
-    if (ptr->outfill || ptr->keepalive)
100
 
-       printf(_("  outfill %d  keepalive %d"),
101
 
-              ptr->outfill, ptr->keepalive);
102
 
+    printf(_("%-9s Link encap:%s  "), ptr->name, hw->title);
103
 
+    /* For some hardware types (eg Ash, ATM) we don't print the 
104
 
+       hardware address if it's null.  */
105
 
+    if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
106
 
+                                 hw->suppress_null_addr)))
107
 
+       printf(_("HWaddr %s  "), hw->print(ptr->hwaddr));
108
 
+#ifdef IFF_PORTSEL
109
 
+    if (ptr->flags & IFF_PORTSEL) {
110
 
+       printf(_("Media:%s"), if_port_text[ptr->map.port][0]);
111
 
+       if (ptr->flags & IFF_AUTOMEDIA)
112
 
+           printf(_("(auto)"));
113
 
+    }
114
 
 #endif
115
 
     printf("\n");
116
 
 
117
 
-
118
 
-
119
 
 #if HAVE_AFINET
120
 
     if (ptr->has_ip) {
121
 
-       printf(_("        %s %s"), ap->name,
122
 
+       printf(_("          %s addr:%s "), ap->name,
123
 
               ap->sprint(&ptr->addr, 1));
124
 
-       printf(_("  netmask %s"), ap->sprint(&ptr->netmask, 1));
125
 
-       if (ptr->flags & IFF_BROADCAST) {
126
 
-           printf(_("  broadcast %s"), ap->sprint(&ptr->broadaddr, 1));
127
 
-       }
128
 
        if (ptr->flags & IFF_POINTOPOINT) {
129
 
-           printf(_("  destination %s"), ap->sprint(&ptr->dstaddr, 1));
130
 
+           printf(_(" P-t-P:%s "), ap->sprint(&ptr->dstaddr, 1));
131
 
        }
132
 
-       printf("\n");
133
 
+       if (ptr->flags & IFF_BROADCAST) {
134
 
+           printf(_(" Bcast:%s "), ap->sprint(&ptr->broadaddr, 1));
135
 
+       }
136
 
+       printf(_(" Mask:%s\n"), ap->sprint(&ptr->netmask, 1));
137
 
     }
138
 
 #endif
139
 
 
140
 
@@ -757,7 +718,7 @@ void ife_print_long(struct interface *pt
141
 
     /* FIXME: should be integrated into interface.c.   */
142
 
 
143
 
     if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
144
 
-       while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %02x %02x %02x %02x %20s\n",
145
 
+       while (fscanf(f, "%4s%4s%4s%4s%4s%4s%4s%4s %08x %02x %02x %02x %20s\n",
146
 
                      addr6p[0], addr6p[1], addr6p[2], addr6p[3],
147
 
                      addr6p[4], addr6p[5], addr6p[6], addr6p[7],
148
 
                  &if_idx, &plen, &scope, &dad_status, devname) != EOF) {
149
 
@@ -766,30 +727,29 @@ void ife_print_long(struct interface *pt
150
 
                        addr6p[0], addr6p[1], addr6p[2], addr6p[3],
151
 
                        addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
152
 
                inet6_aftype.input(1, addr6, (struct sockaddr *) &sap);
153
 
-               printf(_("        %s %s  prefixlen %d"),
154
 
-                       inet6_aftype.name, 
155
 
-                       inet6_aftype.sprint((struct sockaddr *) &sap, 1), 
156
 
-                       plen);
157
 
-               printf(_("  scopeid 0x%x"), scope);
158
 
-
159
 
-               flags[0] = '<'; flags[1] = 0;
160
 
-               if (scope & IPV6_ADDR_COMPATv4) {
161
 
-                       strcat(flags, _("compat,"));
162
 
-                       scope -= IPV6_ADDR_COMPATv4;
163
 
+               printf(_("          inet6 addr: %s/%d"),
164
 
+                inet6_aftype.sprint((struct sockaddr *) &sap, 1), plen);
165
 
+               printf(_(" Scope:"));
166
 
+               switch (scope) {
167
 
+               case 0:
168
 
+                   printf(_("Global"));
169
 
+                   break;
170
 
+               case IPV6_ADDR_LINKLOCAL:
171
 
+                   printf(_("Link"));
172
 
+                   break;
173
 
+               case IPV6_ADDR_SITELOCAL:
174
 
+                   printf(_("Site"));
175
 
+                   break;
176
 
+               case IPV6_ADDR_COMPATv4:
177
 
+                   printf(_("Compat"));
178
 
+                   break;
179
 
+               case IPV6_ADDR_LOOPBACK:
180
 
+                   printf(_("Host"));
181
 
+                   break;
182
 
+               default:
183
 
+                   printf(_("Unknown"));
184
 
                }
185
 
-               if (scope == 0)
186
 
-                       strcat(flags, _("global,"));
187
 
-               if (scope & IPV6_ADDR_LINKLOCAL)
188
 
-                       strcat(flags, _("link,"));
189
 
-               if (scope & IPV6_ADDR_SITELOCAL)
190
 
-                       strcat(flags, _("site,"));
191
 
-               if (scope & IPV6_ADDR_LOOPBACK)
192
 
-                       strcat(flags, _("host,"));
193
 
-               if (flags[strlen(flags)-1] == ',')
194
 
-                       flags[strlen(flags)-1] = '>';
195
 
-               else
196
 
-                       flags[strlen(flags)-1] = 0;
197
 
-               printf("%s\n", flags);
198
 
+               printf("\n");
199
 
            }
200
 
        }
201
 
        fclose(f);
202
 
@@ -802,17 +762,17 @@ void ife_print_long(struct interface *pt
203
 
 
204
 
     if (ipxtype != NULL) {
205
 
        if (ptr->has_ipx_bb)
206
 
-           printf(_("        %s Ethernet-II   %s\n"),
207
 
-                  ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_bb, 1));
208
 
+           printf(_("          IPX/Ethernet II addr:%s\n"),
209
 
+                  ipxtype->sprint(&ptr->ipxaddr_bb, 1));
210
 
        if (ptr->has_ipx_sn)
211
 
-           printf(_("        %s Ethernet-SNAP %s\n"),
212
 
-                  ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_sn, 1));
213
 
+           printf(_("          IPX/Ethernet SNAP addr:%s\n"),
214
 
+                  ipxtype->sprint(&ptr->ipxaddr_sn, 1));
215
 
        if (ptr->has_ipx_e2)
216
 
-           printf(_("        %s Ethernet802.2 %s\n"),
217
 
-                  ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e2, 1));
218
 
+           printf(_("          IPX/Ethernet 802.2 addr:%s\n"),
219
 
+                  ipxtype->sprint(&ptr->ipxaddr_e2, 1));
220
 
        if (ptr->has_ipx_e3)
221
 
-           printf(_("        %s Ethernet802.3 %s\n"),
222
 
-                  ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e3, 1));
223
 
+           printf(_("          IPX/Ethernet 802.3 addr:%s\n"),
224
 
+                  ipxtype->sprint(&ptr->ipxaddr_e3, 1));
225
 
     }
226
 
 #endif
227
 
 
228
 
@@ -821,7 +781,7 @@ void ife_print_long(struct interface *pt
229
 
        ddptype = get_afntype(AF_APPLETALK);
230
 
     if (ddptype != NULL) {
231
 
        if (ptr->has_ddp)
232
 
-           printf(_("        %s %s\n"), ddptype->name, ddptype->sprint(&ptr->ddpaddr, 1));
233
 
+           printf(_("          EtherTalk Phase 2 addr:%s\n"), ddptype->sprint(&ptr->ddpaddr, 1));
234
 
     }
235
 
 #endif
236
 
 
237
 
@@ -830,30 +790,53 @@ void ife_print_long(struct interface *pt
238
 
        ectype = get_afntype(AF_ECONET);
239
 
     if (ectype != NULL) {
240
 
        if (ptr->has_econet)
241
 
-           printf(_("        %s %s\n"), ectype->name, ectype->sprint(&ptr->ecaddr, 1));
242
 
+           printf(_("          econet addr:%s\n"), ectype->sprint(&ptr->ecaddr, 1));
243
 
     }
244
 
 #endif
245
 
 
246
 
-    /* For some hardware types (eg Ash, ATM) we don't print the 
247
 
-       hardware address if it's null.  */
248
 
-    if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) &&
249
 
-                                 hw->suppress_null_addr)))
250
 
-       printf(_("        %s %s"), hw->name, hw->print(ptr->hwaddr));
251
 
-    else
252
 
-       printf(_("        %s"), hw->name);
253
 
-    if (ptr->tx_queue_len != -1)
254
 
-       printf(_("  txqueuelen %d"), ptr->tx_queue_len);
255
 
-    printf("  (%s)\n", hw->title);
256
 
-
257
 
-#ifdef IFF_PORTSEL
258
 
-    if (ptr->flags & IFF_PORTSEL) {
259
 
-       printf(_("        media %s"), if_port_text[ptr->map.port][0]);
260
 
-       if (ptr->flags & IFF_AUTOMEDIA)
261
 
-           printf(_("autoselect"));
262
 
-       printf("\n");
263
 
-    }
264
 
+    printf("          ");
265
 
+    /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
266
 
+    if (ptr->flags == 0)
267
 
+       printf(_("[NO FLAGS] "));
268
 
+    if (ptr->flags & IFF_UP)
269
 
+       printf(_("UP "));
270
 
+    if (ptr->flags & IFF_BROADCAST)
271
 
+       printf(_("BROADCAST "));
272
 
+    if (ptr->flags & IFF_DEBUG)
273
 
+       printf(_("DEBUG "));
274
 
+    if (ptr->flags & IFF_LOOPBACK)
275
 
+       printf(_("LOOPBACK "));
276
 
+    if (ptr->flags & IFF_POINTOPOINT)
277
 
+       printf(_("POINTOPOINT "));
278
 
+    if (ptr->flags & IFF_NOTRAILERS)
279
 
+       printf(_("NOTRAILERS "));
280
 
+    if (ptr->flags & IFF_RUNNING)
281
 
+       printf(_("RUNNING "));
282
 
+    if (ptr->flags & IFF_NOARP)
283
 
+       printf(_("NOARP "));
284
 
+    if (ptr->flags & IFF_PROMISC)
285
 
+       printf(_("PROMISC "));
286
 
+    if (ptr->flags & IFF_ALLMULTI)
287
 
+       printf(_("ALLMULTI "));
288
 
+    if (ptr->flags & IFF_SLAVE)
289
 
+       printf(_("SLAVE "));
290
 
+    if (ptr->flags & IFF_MASTER)
291
 
+       printf(_("MASTER "));
292
 
+    if (ptr->flags & IFF_MULTICAST)
293
 
+       printf(_("MULTICAST "));
294
 
+#ifdef HAVE_DYNAMIC
295
 
+    if (ptr->flags & IFF_DYNAMIC)
296
 
+       printf(_("DYNAMIC "));
297
 
 #endif
298
 
-
299
 
+    /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */
300
 
+    printf(_(" MTU:%d  Metric:%d"),
301
 
+          ptr->mtu, ptr->metric ? ptr->metric : 1);
302
 
+#ifdef SIOCSKEEPALIVE
303
 
+    if (ptr->outfill || ptr->keepalive)
304
 
+       printf(_("  Outfill:%d  Keepalive:%d"),
305
 
+              ptr->outfill, ptr->keepalive);
306
 
+#endif
307
 
+    printf("\n");
308
 
 
309
 
     /* If needed, display the interface statistics. */
310
 
 
311
 
@@ -862,8 +845,19 @@ void ife_print_long(struct interface *pt
312
 
         *      not for the aliases, although strictly speaking they're shared
313
 
         *      by all addresses.
314
 
         */
315
 
+       printf("          ");
316
 
+
317
 
+       printf(_("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"),
318
 
+              ptr->stats.rx_packets, ptr->stats.rx_errors,
319
 
+              ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors,
320
 
+              ptr->stats.rx_frame_errors);
321
 
+       if (can_compress)
322
 
+           printf(_("             compressed:%lu\n"), ptr->stats.rx_compressed);
323
 
+
324
 
        rx = ptr->stats.rx_bytes;  
325
 
+       tx = ptr->stats.tx_bytes;
326
 
        short_rx = rx * 10;  
327
 
+       short_tx = tx * 10;
328
 
        if (rx > 1125899906842624ull) {
329
 
            short_rx /= 1125899906842624ull;
330
 
            Rext = "PiB";
331
 
@@ -880,8 +874,6 @@ void ife_print_long(struct interface *pt
332
 
            short_rx /= 1024;
333
 
            Rext = "KiB";
334
 
        }
335
 
-       tx = ptr->stats.tx_bytes;
336
 
-       short_tx = tx * 10;
337
 
        if (tx > 1125899906842624ull) {
338
 
            short_tx /= 1125899906842624ull;
339
 
            Text = "PiB";
340
 
@@ -899,50 +891,37 @@ void ife_print_long(struct interface *pt
341
 
            Text = "KiB";
342
 
        }
343
 
 
344
 
-       printf("        ");
345
 
-       printf(_("RX packets %llu  bytes %llu (%lu.%lu %s)\n"), 
346
 
-               ptr->stats.rx_packets, 
347
 
-              rx, (unsigned long)(short_rx / 10), 
348
 
-              (unsigned long)(short_rx % 10), Rext);
349
 
-       if (can_compress) {
350
 
-           printf("        ");
351
 
-           printf(_("RX compressed:%lu\n"), ptr->stats.rx_compressed);
352
 
-       }
353
 
-       printf("        ");
354
 
-       printf(_("RX errors %lu  dropped %lu  overruns %lu  frame %lu\n"),
355
 
-              ptr->stats.rx_errors, ptr->stats.rx_dropped, 
356
 
-              ptr->stats.rx_fifo_errors, ptr->stats.rx_frame_errors);
357
 
-
358
 
-
359
 
-       printf("        ");
360
 
-       printf(_("TX packets %llu  bytes %llu (%lu.%lu %s)\n"),
361
 
-               ptr->stats.tx_packets, 
362
 
-               tx, (unsigned long)(short_tx / 10), 
363
 
-               (unsigned long)(short_tx % 10), Text);
364
 
-       if (can_compress) {
365
 
-           printf("        ");
366
 
-           printf(_("TX compressed %lu\n"), ptr->stats.tx_compressed);
367
 
-       }
368
 
-       printf("        ");
369
 
-       printf(_("TX errors %lu  dropped %lu overruns %lu  carrier %lu  collisions %lu\n"),
370
 
-              ptr->stats.tx_errors,
371
 
+       printf("          ");
372
 
+       printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"),
373
 
+              ptr->stats.tx_packets, ptr->stats.tx_errors,
374
 
               ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors,
375
 
-              ptr->stats.tx_carrier_errors, ptr->stats.collisions);
376
 
+              ptr->stats.tx_carrier_errors);
377
 
+       printf(_("          collisions:%lu "), ptr->stats.collisions);
378
 
+       if (can_compress)
379
 
+           printf(_("compressed:%lu "), ptr->stats.tx_compressed);
380
 
+       if (ptr->tx_queue_len != -1)
381
 
+           printf(_("txqueuelen:%d "), ptr->tx_queue_len);
382
 
+       printf("\n          ");
383
 
+       printf(_("RX bytes:%llu (%lu.%lu %s)  TX bytes:%llu (%lu.%lu %s)\n"),
384
 
+              rx, (unsigned long)(short_rx / 10), 
385
 
+              (unsigned long)(short_rx % 10), Rext, 
386
 
+              tx, (unsigned long)(short_tx / 10), 
387
 
+              (unsigned long)(short_tx % 10), Text);
388
 
     }
389
 
 
390
 
     if ((ptr->map.irq || ptr->map.mem_start || ptr->map.dma ||
391
 
         ptr->map.base_addr >= 0x100)) {
392
 
-       printf("        device ");
393
 
+       printf("          ");
394
 
        if (ptr->map.irq)
395
 
-           printf(_("interrupt %d  "), ptr->map.irq);
396
 
+           printf(_("Interrupt:%d "), ptr->map.irq);
397
 
        if (ptr->map.base_addr >= 0x100)        /* Only print devices using it for 
398
 
                                                   I/O maps */
399
 
-           printf(_("base 0x%x  "), ptr->map.base_addr);
400
 
+           printf(_("Base address:0x%x "), ptr->map.base_addr);
401
 
        if (ptr->map.mem_start) {
402
 
-           printf(_("memory 0x%lx-%lx  "), ptr->map.mem_start, ptr->map.mem_end);
403
 
+           printf(_("Memory:%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end);
404
 
        }
405
 
        if (ptr->map.dma)
406
 
-           printf(_("  dma 0x%x"), ptr->map.dma);
407
 
+           printf(_("DMA chan:%x "), ptr->map.dma);
408
 
        printf("\n");
409
 
     }
410
 
     printf("\n");