Gentoo Archives: gentoo-commits

From: "Mike Frysinger (vapier)" <vapier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-apps/net-tools/files/1.60_p20071202044231: 0001-git-ignores.patch 0002-respect-normal-toolchain-envvars.patch 0003-libdir-needs-version.h.patch 0004-document-the-e-option.patch 0005-all-of-the-8-man-pages-are-administrator-not-pr.patch 0006-handle-just-raw-IP-info.patch 0007-prevent-overflows-in-interface-buffers.patch 0008-Mads-Martin-Joergensen-writes.patch 0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch 0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch 0011-comabug-gmail.com-writes.patch
Date: Mon, 14 Apr 2008 05:07:44
Message-Id: E1JlGuq-0000ci-CE@stork.gentoo.org
1 vapier 08/04/14 05:07:40
2
3 Added: 0001-git-ignores.patch
4 0002-respect-normal-toolchain-envvars.patch
5 0003-libdir-needs-version.h.patch
6 0004-document-the-e-option.patch
7 0005-all-of-the-8-man-pages-are-administrator-not-pr.patch
8 0006-handle-just-raw-IP-info.patch
9 0007-prevent-overflows-in-interface-buffers.patch
10 0008-Mads-Martin-Joergensen-writes.patch
11 0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch
12 0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch
13 0011-comabug-gmail.com-writes.patch
14 Log:
15 New version based on current cvs.
16 (Portage version: 2.2_pre5)
17 (Signed Manifest commit)
18
19 Revision Changes Path
20 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0001-git-ignores.patch
21
22 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0001-git-ignores.patch?rev=1.1&view=markup
23 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0001-git-ignores.patch?rev=1.1&content-type=text/plain
24
25 Index: 0001-git-ignores.patch
26 ===================================================================
27 From cc21d43a5991764a2dc2bfc5b22a19cec2f62180 Mon Sep 17 00:00:00 2001
28 From: Mike Frysinger <vapier@g.o>
29 Date: Sun, 13 Apr 2008 23:57:55 -0400
30 Subject: [PATCH] git ignores
31
32 ---
33 .gitignore | 22 ++++++++++++++++++++++
34 1 files changed, 22 insertions(+), 0 deletions(-)
35 create mode 100644 .gitignore
36
37 diff --git a/.gitignore b/.gitignore
38 new file mode 100644
39 index 0000000..f011661
40 --- /dev/null
41 +++ b/.gitignore
42 @@ -0,0 +1,22 @@
43 +*.o
44 +
45 +/config.h
46 +/config.make
47 +/config.status
48 +
49 +/lib/libnet-tools.a
50 +
51 +/version.h
52 +
53 +/arp
54 +/hostname
55 +/ifconfig
56 +/ipmaddr
57 +/iptunnel
58 +/mii-tool
59 +/nameif
60 +/netstat
61 +/plipconfig
62 +/rarp
63 +/route
64 +/slattach
65 --
66 1.5.5
67
68
69
70
71 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0002-respect-normal-toolchain-envvars.patch
72
73 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0002-respect-normal-toolchain-envvars.patch?rev=1.1&view=markup
74 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0002-respect-normal-toolchain-envvars.patch?rev=1.1&content-type=text/plain
75
76 Index: 0002-respect-normal-toolchain-envvars.patch
77 ===================================================================
78 From 8903f55c34c4f7a4bed25b7961717fdf4652704b Mon Sep 17 00:00:00 2001
79 From: Mike Frysinger <vapier@g.o>
80 Date: Sun, 13 Apr 2008 23:58:07 -0400
81 Subject: [PATCH] respect normal toolchain envvars
82
83 ---
84 Makefile | 17 +++++++----------
85 1 files changed, 7 insertions(+), 10 deletions(-)
86
87 diff --git a/Makefile b/Makefile
88 index 8fcc55c..a2f0c77 100644
89 --- a/Makefile
90 +++ b/Makefile
91 @@ -88,10 +88,9 @@ endif
92
93 # Compiler and Linker Options
94 # You may need to uncomment and edit these if you are using libc5 and IPv6.
95 -COPTS = -D_GNU_SOURCE -O2 -Wall -g # -I/usr/inet6/include
96 -ifeq ($(origin LOPTS), undefined)
97 -LOPTS =
98 -endif
99 +CFLAGS ?= -O2 -g
100 +CFLAGS += -Wall
101 +CPPFLAGS += -D_GNU_SOURCE
102 RESLIB = # -L/usr/inet6/lib -linet6
103
104 ifeq ($(HAVE_AFDECnet),1)
105 @@ -113,8 +112,8 @@ endif
106
107 NET_LIB = $(NET_LIB_PATH)/lib$(NET_LIB_NAME).a
108
109 -CFLAGS = $(COPTS) -I. -idirafter ./include/ -I$(NET_LIB_PATH)
110 -LDFLAGS = $(LOPTS) -L$(NET_LIB_PATH)
111 +CPPFLAGS += -I. -idirafter ./include/ -I$(NET_LIB_PATH)
112 +LDFLAGS += -L$(NET_LIB_PATH)
113
114 SUBDIRS = man/ $(NET_LIB_PATH)/
115
116 @@ -125,8 +124,6 @@ LD = $(CC)
117
118 NLIB = -l$(NET_LIB_NAME)
119
120 -MDEFINES = COPTS='$(COPTS)' LOPTS='$(LOPTS)' TOPDIR='$(TOPDIR)'
121 -
122 %.o: %.c config.h version.h intl.h net-features.h $<
123 $(CC) $(CFLAGS) -c $<
124
125 @@ -176,13 +173,13 @@ $(NET_LIB): config.h version.h intl.h libdir
126 i18n.h: i18ndir
127
128 libdir:
129 - @$(MAKE) -C $(NET_LIB_PATH) $(MDEFINES)
130 + @$(MAKE) -C $(NET_LIB_PATH)
131
132 i18ndir:
133 @$(MAKE) -C po
134
135 subdirs:
136 - @for i in $(SUBDIRS); do $(MAKE) -C $$i $(MDEFINES) ; done
137 + @for i in $(SUBDIRS); do $(MAKE) -C $$i ; done
138
139 ifconfig: $(NET_LIB) ifconfig.o
140 $(CC) $(LDFLAGS) -o ifconfig ifconfig.o $(NLIB) $(RESLIB)
141 --
142 1.5.5
143
144
145
146
147 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0003-libdir-needs-version.h.patch
148
149 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0003-libdir-needs-version.h.patch?rev=1.1&view=markup
150 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0003-libdir-needs-version.h.patch?rev=1.1&content-type=text/plain
151
152 Index: 0003-libdir-needs-version.h.patch
153 ===================================================================
154 From 396d2d99db901296449663782a7ea13b1d0d6b51 Mon Sep 17 00:00:00 2001
155 From: Mike Frysinger <vapier@g.o>
156 Date: Mon, 14 Apr 2008 00:17:39 -0400
157 Subject: [PATCH] libdir needs version.h
158
159 ---
160 Makefile | 2 +-
161 1 files changed, 1 insertions(+), 1 deletions(-)
162
163 diff --git a/Makefile b/Makefile
164 index a2f0c77..382cbf2 100644
165 --- a/Makefile
166 +++ b/Makefile
167 @@ -172,7 +172,7 @@ $(NET_LIB): config.h version.h intl.h libdir
168
169 i18n.h: i18ndir
170
171 -libdir:
172 +libdir: version.h
173 @$(MAKE) -C $(NET_LIB_PATH)
174
175 i18ndir:
176 --
177 1.5.5
178
179
180
181
182 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0004-document-the-e-option.patch
183
184 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0004-document-the-e-option.patch?rev=1.1&view=markup
185 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0004-document-the-e-option.patch?rev=1.1&content-type=text/plain
186
187 Index: 0004-document-the-e-option.patch
188 ===================================================================
189 From ea596e184e45d3cb08fbb0f4269f9bcbf3256ed3 Mon Sep 17 00:00:00 2001
190 From: Mike Frysinger <vapier@g.o>
191 Date: Mon, 14 Apr 2008 00:32:40 -0400
192 Subject: [PATCH] document the -e option
193
194 ---
195 arp.c | 1 +
196 man/en_US/arp.8 | 7 +++++--
197 2 files changed, 6 insertions(+), 2 deletions(-)
198
199 diff --git a/arp.c b/arp.c
200 index 4ee5c58..26ab326 100644
201 --- a/arp.c
202 +++ b/arp.c
203 @@ -630,6 +630,7 @@ static void usage(void)
204 fprintf(stderr, _(" arp [-v] [<HW>] [-i <if>] -Ds <host> <if> [netmask <nm>] pub <-''-\n\n"));
205
206 fprintf(stderr, _(" -a display (all) hosts in alternative (BSD) style\n"));
207 + fprintf(stderr, _(" -e display (all) hosts in default (Linux) style\n"));
208 fprintf(stderr, _(" -s, --set set a new ARP entry\n"));
209 fprintf(stderr, _(" -d, --delete delete a specified entry\n"));
210 fprintf(stderr, _(" -v, --verbose be verbose\n"));
211 diff --git a/man/en_US/arp.8 b/man/en_US/arp.8
212 index 4d20ed3..281047d 100644
213 --- a/man/en_US/arp.8
214 +++ b/man/en_US/arp.8
215 @@ -8,7 +8,7 @@ arp \- manipulate the system ARP cache
216 .IR type ]
217 .RB [ \-i
218 .IR if ]
219 -.RB [ \-a ]
220 +.RB [ \-ae ]
221 .RI [ hostname ]
222 .PP
223 .B arp
224 @@ -115,7 +115,7 @@ Tell the user what is going on by being verbose.
225 shows numerical addresses instead of trying to determine symbolic host, port
226 or user names.
227 .TP
228 -.B "\-H type, \-\-hw-type type"
229 +.B "\-H type, \-\-hw-type type, \-t type"
230 When setting or reading the ARP cache, this optional parameter tells
231 .B arp
232 which class of entries it should check for. The default value of
233 @@ -134,6 +134,9 @@ and
234 .B \-a
235 Use alternate BSD style output format (with no fixed columns).
236 .TP
237 +.B \-e
238 +Use default Linux style output format (with fixed columns).
239 +.TP
240 .B "\-D, \-\-use-device"
241 Instead of a hw_addr, the given argument is the name of an interface.
242 .B arp
243 --
244 1.5.5
245
246
247
248
249 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0005-all-of-the-8-man-pages-are-administrator-not-pr.patch
250
251 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0005-all-of-the-8-man-pages-are-administrator-not-pr.patch?rev=1.1&view=markup
252 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0005-all-of-the-8-man-pages-are-administrator-not-pr.patch?rev=1.1&content-type=text/plain
253
254 Index: 0005-all-of-the-8-man-pages-are-administrator-not-pr.patch
255 ===================================================================
256 From fbb893d0d1655fd514a55da22dccd28693e63031 Mon Sep 17 00:00:00 2001
257 From: Mike Frysinger <vapier@g.o>
258 Date: Mon, 14 Apr 2008 00:35:00 -0400
259 Subject: [PATCH] all of the (8) man pages are "administrator" not "programmer" manpages
260
261 ---
262 man/en_US/arp.8 | 2 +-
263 man/en_US/ifconfig.8 | 2 +-
264 man/en_US/netstat.8 | 2 +-
265 man/en_US/rarp.8 | 2 +-
266 man/en_US/route.8 | 2 +-
267 man/fr_FR/arp.8 | 2 +-
268 man/fr_FR/ifconfig.8 | 2 +-
269 man/fr_FR/netstat.8 | 2 +-
270 man/fr_FR/rarp.8 | 2 +-
271 man/fr_FR/route.8 | 2 +-
272 10 files changed, 10 insertions(+), 10 deletions(-)
273
274 diff --git a/man/en_US/arp.8 b/man/en_US/arp.8
275 index 281047d..93feb04 100644
276 --- a/man/en_US/arp.8
277 +++ b/man/en_US/arp.8
278 @@ -1,4 +1,4 @@
279 -.TH ARP 8 "2007-12-01" "net-tools" "Linux Programmer's Manual"
280 +.TH ARP 8 "2007-12-01" "net-tools" "Linux Administrator's Manual"
281 .SH NAME
282 arp \- manipulate the system ARP cache
283 .SH SYNOPSIS
284 diff --git a/man/en_US/ifconfig.8 b/man/en_US/ifconfig.8
285 index 410677e..ac5c829 100644
286 --- a/man/en_US/ifconfig.8
287 +++ b/man/en_US/ifconfig.8
288 @@ -1,4 +1,4 @@
289 -.TH IFCONFIG 8 "2007-11-07" "net-tools" "Linux Programmer's Manual"
290 +.TH IFCONFIG 8 "2007-11-07" "net-tools" "Linux Administrator's Manual"
291 .SH NAME
292 ifconfig \- configure a network interface
293 .SH SYNOPSIS
294 diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8
295 index 7a8a42c..e6be46b 100644
296 --- a/man/en_US/netstat.8
297 +++ b/man/en_US/netstat.8
298 @@ -8,7 +8,7 @@
299 .\" Modified: Tuan Hoang tqhoang@×××××××.com
300 .\"
301 .\"
302 -.TH NETSTAT 8 "2007-12-02" "net-tools" "Linux Programmer's Manual"
303 +.TH NETSTAT 8 "2007-12-02" "net-tools" "Linux Administrator's Manual"
304
305 .SH NAME
306 netstat \- Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
307 diff --git a/man/en_US/rarp.8 b/man/en_US/rarp.8
308 index 1186aa8..c450f13 100644
309 --- a/man/en_US/rarp.8
310 +++ b/man/en_US/rarp.8
311 @@ -1,4 +1,4 @@
312 -.TH RARP 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
313 +.TH RARP 8 "4 August 1997" "net-tools" "Linux Administrator's Manual"
314 .SH NAME
315 rarp \- manipulate the system RARP table
316 .SH SYNOPSIS
317 diff --git a/man/en_US/route.8 b/man/en_US/route.8
318 index 6c06017..9aa4ff1 100644
319 --- a/man/en_US/route.8
320 +++ b/man/en_US/route.8
321 @@ -1,4 +1,4 @@
322 -.TH ROUTE 8 "02 October 2003" "net-tools" "Linux Programmer's Manual"
323 +.TH ROUTE 8 "02 October 2003" "net-tools" "Linux Administrator's Manual"
324 .SH NAME
325 route \- show / manipulate the IP routing table
326 .SH SYNOPSIS
327 diff --git a/man/fr_FR/arp.8 b/man/fr_FR/arp.8
328 index b658aa5..50dbc99 100644
329 --- a/man/fr_FR/arp.8
330 +++ b/man/fr_FR/arp.8
331 @@ -1,4 +1,4 @@
332 -.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Programmer's Manual"
333 +.TH ARP 8 "5 Jan 1999" "net-tools" "Linux Administrator's Manual"
334 .SH NOM
335 arp \- manipule la table ARP du système
336 .SH SYNOPSIS
337 diff --git a/man/fr_FR/ifconfig.8 b/man/fr_FR/ifconfig.8
338 index af58e56..afed13a 100644
339 --- a/man/fr_FR/ifconfig.8
340 +++ b/man/fr_FR/ifconfig.8
341 @@ -1,4 +1,4 @@
342 -.TH IFCONFIG 8 "4 August 1997" "net-tools" "Linux Programmer's Manual"
343 +.TH IFCONFIG 8 "4 August 1997" "net-tools" "Linux Administrator's Manual"
344 .SH NOM
345 ifconfig \- configure une interface réseau
346 .SH SYNOPSIS
347 diff --git a/man/fr_FR/netstat.8 b/man/fr_FR/netstat.8
348 index 5ec3721..d92fbcb 100644
349 --- a/man/fr_FR/netstat.8
350 +++ b/man/fr_FR/netstat.8
351 @@ -8,7 +8,7 @@
352 .\" Modified: Tuan Hoang tuan@×××××××××××××.org
353 .\"
354 .\"
355 -.TH NETSTAT 8 "2007-12-02" "net-tools" "Linux Programmer's Manual"
356 +.TH NETSTAT 8 "2007-12-02" "net-tools" "Linux Administrator's Manual"
357
358 .SH NAME
359 netstat \- Affiche les connexions réseau, les tables de routage, les
360 diff --git a/man/fr_FR/rarp.8 b/man/fr_FR/rarp.8
361 index 57a2281..1098c63 100644
362 --- a/man/fr_FR/rarp.8
363 +++ b/man/fr_FR/rarp.8
364 @@ -1,4 +1,4 @@
365 -.TH RARP 8 "4 Août 1997" "net-tools" "Linux Programmer's Manual"
366 +.TH RARP 8 "4 Août 1997" "net-tools" "Linux Administrator's Manual"
367 .SH NOM
368 rarp \- manipule la table système RARP
369 .SH SYNOPSIS
370 diff --git a/man/fr_FR/route.8 b/man/fr_FR/route.8
371 index 9109e8d..bf9863c 100644
372 --- a/man/fr_FR/route.8
373 +++ b/man/fr_FR/route.8
374 @@ -1,4 +1,4 @@
375 -.TH ROUTE 8 "8 Août 1997" "net-tools" "Linux Programmer's Manual"
376 +.TH ROUTE 8 "8 Août 1997" "net-tools" "Linux Administrator's Manual"
377 .SH NAME
378 route \- affiche / manipule la table de routage IP
379 .SH SYNOPSIS
380 --
381 1.5.5
382
383
384
385
386 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0006-handle-just-raw-IP-info.patch
387
388 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0006-handle-just-raw-IP-info.patch?rev=1.1&view=markup
389 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0006-handle-just-raw-IP-info.patch?rev=1.1&content-type=text/plain
390
391 Index: 0006-handle-just-raw-IP-info.patch
392 ===================================================================
393 From b7171f3e8a16766e1543e3e3ca797371466cbf87 Mon Sep 17 00:00:00 2001
394 From: Mike Frysinger <vapier@g.o>
395 Date: Mon, 14 Apr 2008 00:35:59 -0400
396 Subject: [PATCH] handle just raw "IP" info
397
398 ---
399 lib/masq_info.c | 4 +++-
400 1 files changed, 3 insertions(+), 1 deletions(-)
401
402 diff --git a/lib/masq_info.c b/lib/masq_info.c
403 index 45ca689..93eb04f 100644
404 --- a/lib/masq_info.c
405 +++ b/lib/masq_info.c
406 @@ -119,7 +119,9 @@ static int read_masqinfo(FILE * f, struct masq *mslist, int nmslist)
407 ms->src.sin_family = AF_INET;
408 ms->dst.sin_family = AF_INET;
409
410 - if (strcmp("TCP", buf) == 0)
411 + if (strcmp("IP", buf) == 0)
412 + ms->proto = "ip";
413 + else if (strcmp("TCP", buf) == 0)
414 ms->proto = "tcp";
415 else if (strcmp("UDP", buf) == 0)
416 ms->proto = "udp";
417 --
418 1.5.5
419
420
421
422
423 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0007-prevent-overflows-in-interface-buffers.patch
424
425 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0007-prevent-overflows-in-interface-buffers.patch?rev=1.1&view=markup
426 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0007-prevent-overflows-in-interface-buffers.patch?rev=1.1&content-type=text/plain
427
428 Index: 0007-prevent-overflows-in-interface-buffers.patch
429 ===================================================================
430 From bef310c8274c7df6e004ae0e927e0d757a85c586 Mon Sep 17 00:00:00 2001
431 From: Mike Frysinger <vapier@g.o>
432 Date: Mon, 14 Apr 2008 00:39:09 -0400
433 Subject: [PATCH] prevent overflows in interface buffers
434
435 ---
436 netstat.c | 18 ++++++++++++------
437 1 files changed, 12 insertions(+), 6 deletions(-)
438
439 diff --git a/netstat.c b/netstat.c
440 index dcd1f8a..8057d78 100644
441 --- a/netstat.c
442 +++ b/netstat.c
443 @@ -784,7 +784,8 @@ static void tcp_do_one(int lnr, const char *line)
444 local_addr[22 - strlen(buffer)] = '\0';
445
446 strcat(local_addr, ":");
447 - strcat(local_addr, buffer);
448 + strncat(local_addr, buffer, sizeof(local_addr));
449 + local_addr[sizeof(local_addr)-1] = 0;
450 snprintf(buffer, sizeof(buffer), "%s",
451 get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
452
453 @@ -792,7 +793,8 @@ static void tcp_do_one(int lnr, const char *line)
454 rem_addr[22 - strlen(buffer)] = '\0';
455
456 strcat(rem_addr, ":");
457 - strcat(rem_addr, buffer);
458 + strncat(rem_addr, buffer, sizeof(rem_addr));
459 + rem_addr[sizeof(rem_addr)-1] = 0;
460 timers[0] = '\0';
461
462 if (flag_opt)
463 @@ -936,7 +938,8 @@ static void udp_do_one(int lnr, const char *line)
464 if ((strlen(local_addr) + strlen(buffer)) > 22)
465 local_addr[22 - strlen(buffer)] = '\0';
466 strcat(local_addr, ":");
467 - strcat(local_addr, buffer);
468 + strncat(local_addr, buffer, sizeof(local_addr));
469 + local_addr[sizeof(local_addr)-1] = 0;
470
471 snprintf(buffer, sizeof(buffer), "%s",
472 get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
473 @@ -945,7 +948,8 @@ static void udp_do_one(int lnr, const char *line)
474 if ((strlen(rem_addr) + strlen(buffer)) > 22)
475 rem_addr[22 - strlen(buffer)] = '\0';
476 strcat(rem_addr, ":");
477 - strcat(rem_addr, buffer);
478 + strncat(rem_addr, buffer, sizeof(rem_addr));
479 + rem_addr[sizeof(rem_addr)-1] = 0;
480
481 timers[0] = '\0';
482 if (flag_opt)
483 @@ -1058,7 +1062,8 @@ static void raw_do_one(int lnr, const char *line)
484 if ((strlen(local_addr) + strlen(buffer)) > 22)
485 local_addr[22 - strlen(buffer)] = '\0';
486 strcat(local_addr, ":");
487 - strcat(local_addr, buffer);
488 + strncat(local_addr, buffer, sizeof(local_addr));
489 + local_addr[sizeof(local_addr)-1] = 0;
490
491 snprintf(buffer, sizeof(buffer), "%s",
492 get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
493 @@ -1067,7 +1072,8 @@ static void raw_do_one(int lnr, const char *line)
494 if ((strlen(rem_addr) + strlen(buffer)) > 22)
495 rem_addr[22 - strlen(buffer)] = '\0';
496 strcat(rem_addr, ":");
497 - strcat(rem_addr, buffer);
498 + strncat(rem_addr, buffer, sizeof(rem_addr));
499 + rem_addr[sizeof(rem_addr)-1] = 0;
500
501 timers[0] = '\0';
502 if (flag_opt)
503 --
504 1.5.5
505
506
507
508
509 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0008-Mads-Martin-Joergensen-writes.patch
510
511 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0008-Mads-Martin-Joergensen-writes.patch?rev=1.1&view=markup
512 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0008-Mads-Martin-Joergensen-writes.patch?rev=1.1&content-type=text/plain
513
514 Index: 0008-Mads-Martin-Joergensen-writes.patch
515 ===================================================================
516 From fcfb7fa902fcfc23e9fe78bb57748c110b972029 Mon Sep 17 00:00:00 2001
517 From: Mike Frysinger <vapier@g.o>
518 Date: Mon, 14 Apr 2008 00:39:50 -0400
519 Subject: [PATCH] Mads Martin Joergensen writes:
520 According to the manual the option "--numeric-ports" should not
521 affect host resolution, but it does. All connected hosts are displayed
522 with numeric values instead of their FQDN.
523
524 http://bugs.gentoo.org/76756
525 ---
526 netstat.c | 12 ++++++------
527 1 files changed, 6 insertions(+), 6 deletions(-)
528
529 diff --git a/netstat.c b/netstat.c
530 index 8057d78..843c06b 100644
531 --- a/netstat.c
532 +++ b/netstat.c
533 @@ -772,8 +772,8 @@ static void tcp_do_one(int lnr, const char *line)
534 txq = 0L;
535 }
536 safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
537 - flag_not), sizeof(local_addr));
538 - safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not),
539 + flag_not & FLAG_NUM_HOST), sizeof(local_addr));
540 + safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr, flag_not & FLAG_NUM_HOST),
541 sizeof(rem_addr));
542 if (flag_all || (flag_lst && !rem_port) || (!flag_lst && rem_port)) {
543 snprintf(buffer, sizeof(buffer), "%s",
544 @@ -931,7 +931,7 @@ static void udp_do_one(int lnr, const char *line)
545 if (flag_all || (notnull(remaddr) && !flag_lst) || (!notnull(remaddr) && flag_lst))
546 {
547 safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
548 - flag_not), sizeof(local_addr));
549 + flag_not & FLAG_NUM_HOST), sizeof(local_addr));
550 snprintf(buffer, sizeof(buffer), "%s",
551 get_sname(htons(local_port), "udp",
552 flag_not & FLAG_NUM_PORT));
553 @@ -944,7 +944,7 @@ static void udp_do_one(int lnr, const char *line)
554 snprintf(buffer, sizeof(buffer), "%s",
555 get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
556 safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
557 - flag_not), sizeof(rem_addr));
558 + flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
559 if ((strlen(rem_addr) + strlen(buffer)) > 22)
560 rem_addr[22 - strlen(buffer)] = '\0';
561 strcat(rem_addr, ":");
562 @@ -1058,7 +1058,7 @@ static void raw_do_one(int lnr, const char *line)
563 get_sname(htons(local_port), "raw",
564 flag_not & FLAG_NUM_PORT));
565 safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
566 - flag_not), sizeof(local_addr));
567 + flag_not & FLAG_NUM_HOST), sizeof(local_addr));
568 if ((strlen(local_addr) + strlen(buffer)) > 22)
569 local_addr[22 - strlen(buffer)] = '\0';
570 strcat(local_addr, ":");
571 @@ -1068,7 +1068,7 @@ static void raw_do_one(int lnr, const char *line)
572 snprintf(buffer, sizeof(buffer), "%s",
573 get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
574 safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
575 - flag_not), sizeof(rem_addr));
576 + flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
577 if ((strlen(rem_addr) + strlen(buffer)) > 22)
578 rem_addr[22 - strlen(buffer)] = '\0';
579 strcat(rem_addr, ":");
580 --
581 1.5.5
582
583
584
585
586 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch
587
588 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch?rev=1.1&view=markup
589 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch?rev=1.1&content-type=text/plain
590
591 Index: 0009-Patch-by-pasi.valminen-hut.fi-to-fix-FQDN-handling-w.patch
592 ===================================================================
593 From d894c8c42415fb8e5148dc0ba073078acb99a607 Mon Sep 17 00:00:00 2001
594 From: Mike Frysinger <vapier@g.o>
595 Date: Mon, 14 Apr 2008 00:40:29 -0400
596 Subject: [PATCH] Patch by pasi.valminen@×××.fi to fix FQDN handling with AAAA records
597
598 http://bugs.gentoo.org/42650
599 ---
600 hostname.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++--------
601 1 files changed, 61 insertions(+), 10 deletions(-)
602
603 diff --git a/hostname.c b/hostname.c
604 index c4c5aa0..e8ed156 100644
605 --- a/hostname.c
606 +++ b/hostname.c
607 @@ -36,6 +36,10 @@
608 #include <getopt.h>
609 #include <string.h>
610 #include <netdb.h>
611 +#ifdef IPV6
612 +#include <sys/socket.h> /* for PF_INET6 */
613 +#include <sys/types.h> /* for inet_ntop */
614 +#endif /* IPV6 */
615 #include <errno.h>
616 #include <sys/param.h>
617 #include <netinet/in.h>
618 @@ -125,15 +129,23 @@ static void setdname(char *dname)
619 static void showhname(char *hname, int c)
620 {
621 struct hostent *hp;
622 +#ifdef IPV6
623 + struct in6_addr **ip6;
624 +#endif /* IPV6 */
625 register char *p, **alias;
626 struct in_addr **ip;
627
628 if (opt_v)
629 fprintf(stderr, _("Resolving `%s' ...\n"), hname);
630 - if (!(hp = gethostbyname(hname))) {
631 + if (
632 +#ifdef IPV6
633 + !(hp = gethostbyname2(hname, PF_INET6)) &&
634 +#endif /* IPV6 */
635 + !(hp = gethostbyname(hname))) {
636 herror(program_name);
637 exit(1);
638 }
639 +
640 if (opt_v) {
641 fprintf(stderr, _("Result: h_name=`%s'\n"),
642 hp->h_name);
643 @@ -142,11 +154,28 @@ static void showhname(char *hname, int c)
644 while (alias[0])
645 fprintf(stderr, _("Result: h_aliases=`%s'\n"),
646 *alias++);
647 -
648 - ip = (struct in_addr **) hp->h_addr_list;
649 - while (ip[0])
650 - fprintf(stderr, _("Result: h_addr_list=`%s'\n"),
651 - inet_ntoa(**ip++));
652 +#ifdef IPV6
653 + if(hp->h_addrtype == PF_INET6) {
654 + char addr[INET6_ADDRSTRLEN + 1];
655 + addr[INET6_ADDRSTRLEN] = '\0';
656 + ip6 = (struct in6_addr **) hp->h_addr_list;
657 + while(ip6[0]) {
658 + if(inet_ntop(PF_INET6, *ip6++, addr, INET6_ADDRSTRLEN))
659 + fprintf(stderr, _("Result: h_addr_list=`%s'\n"), addr);
660 + else if(errno == EAFNOSUPPORT)
661 + fprintf(stderr, _("%s: protocol family not supported\n"),
662 + program_name);
663 + else if(errno == ENOSPC)
664 + fprintf(stderr, _("%s: name too long\n"), program_name);
665 + }
666 + } else
667 +#endif /* IPV6 */
668 + {
669 + ip = (struct in_addr **) hp->h_addr_list;
670 + while (ip[0])
671 + fprintf(stderr, _("Result: h_addr_list=`%s'\n"),
672 + inet_ntoa(**ip++));
673 + }
674 }
675 if (!(p = strchr(hp->h_name, '.')) && (c == 'd'))
676 return;
677 @@ -158,10 +187,32 @@ static void showhname(char *hname, int c)
678 printf("\n");
679 break;
680 case 'i':
681 - while (hp->h_addr_list[0])
682 - printf("%s ", inet_ntoa(*(struct in_addr *) *hp->h_addr_list++));
683 - printf("\n");
684 - break;
685 +#ifdef IPV6
686 + if(hp->h_addrtype == PF_INET6) {
687 + char addr[INET6_ADDRSTRLEN + 1];
688 + addr[INET6_ADDRSTRLEN] = '\0';
689 + while(hp->h_addr_list[0]) {
690 + if(inet_ntop(PF_INET6, (struct in6_addr *)*hp->h_addr_list++,
691 + addr, INET6_ADDRSTRLEN))
692 + printf("%s ", addr);
693 + else if(errno == EAFNOSUPPORT) {
694 + fprintf(stderr, _("\n%s: protocol family not supported\n"),
695 + program_name);
696 + exit(1);
697 + } else if(errno == ENOSPC) {
698 + fprintf(stderr, _("\n%s: name too long\n"), program_name);
699 + exit(1);
700 + }
701 + printf("\n");
702 + }
703 + } else
704 +#endif /* IPV6 */
705 + {
706 + while (hp->h_addr_list[0])
707 + printf("%s ", inet_ntoa(*(struct in_addr *)*hp->h_addr_list++));
708 + printf("\n");
709 + }
710 + break;
711 case 'd':
712 printf("%s\n", ++p);
713 break;
714 --
715 1.5.5
716
717
718
719
720 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch
721
722 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch?rev=1.1&view=markup
723 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch?rev=1.1&content-type=text/plain
724
725 Index: 0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch
726 ===================================================================
727 From 9fb2c65b56df96c7bc9538c2b40028df0a1a3255 Mon Sep 17 00:00:00 2001
728 From: Mike Frysinger <vapier@g.o>
729 Date: Mon, 14 Apr 2008 00:42:18 -0400
730 Subject: [PATCH] Patch by Tom Duffy <tduffy@×××.com> to teach ifconfig about infiniband
731
732 http://bugs.gentoo.org/81180
733 ---
734 config.in | 1 +
735 lib/Makefile | 2 +-
736 lib/hw.c | 8 +++
737 lib/ib.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
738 4 files changed, 157 insertions(+), 1 deletions(-)
739 create mode 100644 lib/ib.c
740
741 diff --git a/config.in b/config.in
742 index 2999cd1..da09827 100644
743 --- a/config.in
744 +++ b/config.in
745 @@ -83,6 +83,7 @@ bool '(Cisco)-HDLC/LAPB support' HAVE_HWHDLCLAPB y
746 bool 'IrDA support' HAVE_HWIRDA y
747 bool 'Econet hardware support' HAVE_HWEC y
748 bool 'Generic EUI-64 hardware support' HAVE_HWEUI64 y
749 +bool 'InfiniBand hardware support' HAVE_HWIB y
750
751 *
752 *
753 diff --git a/lib/Makefile b/lib/Makefile
754 index f4b5cbd..976ebb8 100644
755 --- a/lib/Makefile
756 +++ b/lib/Makefile
757 @@ -16,7 +16,7 @@
758 #
759
760
761 -HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o eui64.o
762 +HWOBJS = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o hippi.o hdlclapb.o strip.o irda.o ec_hw.o x25.o eui64.o ib.o
763 AFOBJS = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o rose.o econet.o x25.o
764 AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o getroute.o x25_gr.o
765 AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o x25_sr.o
766 diff --git a/lib/hw.c b/lib/hw.c
767 index c714313..fd6ea76 100644
768 --- a/lib/hw.c
769 +++ b/lib/hw.c
770 @@ -75,6 +75,8 @@ extern struct hwtype ec_hwtype;
771
772 extern struct hwtype eui64_hwtype;
773
774 +extern struct hwtype ib_hwtype;
775 +
776 static struct hwtype *hwtypes[] =
777 {
778
779 @@ -149,6 +151,9 @@ static struct hwtype *hwtypes[] =
780 #if HAVE_HWEUI64
781 &eui64_hwtype,
782 #endif
783 +#if HAVE_HWIB
784 + &ib_hwtype,
785 +#endif
786 &unspec_hwtype,
787 NULL
788 };
789 @@ -225,6 +230,9 @@ void hwinit()
790 #if HAVE_HWEUI64
791 eui64_hwtype.title = _("Generic EUI-64");
792 #endif
793 +#if HAVE_HWIB
794 + ib_hwtype.title = _("InfiniBand");
795 +#endif
796 sVhwinit = 1;
797 }
798
799 diff --git a/lib/ib.c b/lib/ib.c
800 new file mode 100644
801 index 0000000..aa3d8f9
802 --- /dev/null
803 +++ b/lib/ib.c
804 @@ -0,0 +1,147 @@
805 +/*
806 + * lib/ib.c This file contains an implementation of the "Infiniband"
807 + * support functions.
808 + *
809 + * Version: $Id: 0010-Patch-by-Tom-Duffy-tduffy-sun.com-to-teach-ifconfi.patch,v 1.1 2008/04/14 05:07:39 vapier Exp $
810 + *
811 + * Author: Fred N. van Kempen, <waltje@×××××××××××××××.org>
812 + * Copyright 1993 MicroWalt Corporation
813 + * Tom Duffy <tduffy@×××.com>
814 + *
815 + * This program is free software; you can redistribute it
816 + * and/or modify it under the terms of the GNU General
817 + * Public License as published by the Free Software
818 + * Foundation; either version 2 of the License, or (at
819 + * your option) any later version.
820 + */
821 +#include "config.h"
822 +
823 +#if HAVE_HWIB
824 +#include <sys/types.h>
825 +#include <sys/socket.h>
826 +#include <net/if_arp.h>
827 +#include <linux/if_infiniband.h>
828 +#include <stdlib.h>
829 +#include <stdio.h>
830 +#include <errno.h>
831 +#include <ctype.h>
832 +#include <string.h>
833 +#include <unistd.h>
834 +#include "net-support.h"
835 +#include "pathnames.h"
836 +#include "intl.h"
837 +#include "util.h"
838 +
839 +extern struct hwtype ib_hwtype;
840 +
841 +
842 +/* Display an InfiniBand address in readable format. */
843 +static char *pr_ib(unsigned char *ptr)
844 +{
845 + static char buff[128];
846 + char *pos;
847 + unsigned int i;
848 +
849 + pos = buff;
850 + for (i = 0; i < INFINIBAND_ALEN; i++) {
851 + pos += sprintf(pos, "%02X:", (*ptr++ & 0377));
852 + }
853 + buff[strlen(buff) - 1] = '\0';
854 +
855 + /* snprintf(buff, sizeof(buff), "%02X:%02X:%02X:%02X:%02X:%02X",
856 + (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
857 + (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
858 + );
859 + */
860 + return (buff);
861 +}
862 +
863 +
864 +/* Input an Infiniband address and convert to binary. */
865 +static int in_ib(char *bufp, struct sockaddr *sap)
866 +{
867 + unsigned char *ptr;
868 + char c, *orig;
869 + int i;
870 + unsigned val;
871 +
872 + sap->sa_family = ib_hwtype.type;
873 + ptr = sap->sa_data;
874 +
875 + i = 0;
876 + orig = bufp;
877 + while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) {
878 + val = 0;
879 + c = *bufp++;
880 + if (isdigit(c))
881 + val = c - '0';
882 + else if (c >= 'a' && c <= 'f')
883 + val = c - 'a' + 10;
884 + else if (c >= 'A' && c <= 'F')
885 + val = c - 'A' + 10;
886 + else {
887 +#ifdef DEBUG
888 + fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
889 +#endif
890 + errno = EINVAL;
891 + return (-1);
892 + }
893 + val <<= 4;
894 + c = *bufp;
895 + if (isdigit(c))
896 + val |= c - '0';
897 + else if (c >= 'a' && c <= 'f')
898 + val |= c - 'a' + 10;
899 + else if (c >= 'A' && c <= 'F')
900 + val |= c - 'A' + 10;
901 + else if (c == ':' || c == 0)
902 + val >>= 4;
903 + else {
904 +#ifdef DEBUG
905 + fprintf(stderr, _("in_ib(%s): invalid infiniband address!\n"), orig);
906 +#endif
907 + errno = EINVAL;
908 + return (-1);
909 + }
910 + if (c != 0)
911 + bufp++;
912 + *ptr++ = (unsigned char) (val & 0377);
913 + i++;
914 +
915 + /* We might get a semicolon here - not required. */
916 + if (*bufp == ':') {
917 + if (i == INFINIBAND_ALEN) {
918 +#ifdef DEBUG
919 + fprintf(stderr, _("in_ib(%s): trailing : ignored!\n"),
920 + orig)
921 +#endif
922 + ; /* nothing */
923 + }
924 + bufp++;
925 + }
926 + }
927 +
928 + /* That's it. Any trailing junk? */
929 + if ((i == INFINIBAND_ALEN) && (*bufp != '\0')) {
930 +#ifdef DEBUG
931 + fprintf(stderr, _("in_ib(%s): trailing junk!\n"), orig);
932 + errno = EINVAL;
933 + return (-1);
934 +#endif
935 + }
936 +#ifdef DEBUG
937 + fprintf(stderr, "in_ib(%s): %s\n", orig, pr_ib(sap->sa_data));
938 +#endif
939 +
940 + return (0);
941 +}
942 +
943 +
944 +struct hwtype ib_hwtype =
945 +{
946 + "infiniband", NULL, ARPHRD_INFINIBAND, INFINIBAND_ALEN,
947 + pr_ib, in_ib, NULL
948 +};
949 +
950 +
951 +#endif /* HAVE_HWETHER */
952 --
953 1.5.5
954
955
956
957
958 1.1 sys-apps/net-tools/files/1.60_p20071202044231/0011-comabug-gmail.com-writes.patch
959
960 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0011-comabug-gmail.com-writes.patch?rev=1.1&view=markup
961 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/net-tools/files/1.60_p20071202044231/0011-comabug-gmail.com-writes.patch?rev=1.1&content-type=text/plain
962
963 Index: 0011-comabug-gmail.com-writes.patch
964 ===================================================================
965 From b1c72a13d07b59fc67a7b338fa3969b96af7e67d Mon Sep 17 00:00:00 2001
966 From: Mike Frysinger <vapier@g.o>
967 Date: Mon, 14 Apr 2008 00:47:37 -0400
968 Subject: [PATCH] comabug@×××××.com writes:
969
970 net-tools' netstat should have a -W flag like FreeBSD.
971 There is currently no way to get the full hostname from netstat
972 for local/remote hostnames.
973
974 http://bugs.gentoo.org/53731
975 ---
976 man/en_US/netstat.8 | 3 +++
977 netstat.c | 20 +++++++++++++-------
978 2 files changed, 16 insertions(+), 7 deletions(-)
979
980 diff --git a/man/en_US/netstat.8 b/man/en_US/netstat.8
981 index e6be46b..9a3ff44 100644
982 --- a/man/en_US/netstat.8
983 +++ b/man/en_US/netstat.8
984 @@ -24,6 +24,7 @@ netstat \- Print network connections, routing tables, interface statistics, masq
985 .RB [ \-\-all | \-a ]
986 .RB [ \-\-numeric | \-n ]
987 .RB [ \-\-numeric-hosts "] [" \-\-numeric-ports "] [" \-\-numeric-users ]
988 +.RB [ \-\-wide | \-W]
989 .RB [ \-\-symbolic | \-N ]
990 .RB [ \-\-extend | \-e [ \-\-extend | \-e] ]
991 .RB [ \-\-timers | \-o ]
992 @@ -130,6 +131,8 @@ host or user names.
993 .SS "\-\-numeric-users"
994 shows numerical user IDs but does not affect the resolution of host or
995 port names.
996 +.SS "\-\-wide , \-W"
997 +Don't truncate host names.
998
999 .SS "\-\-protocol=\fIfamily \fR, \fB\-A"
1000 Specifies the address families (perhaps better described as low level
1001 diff --git a/netstat.c b/netstat.c
1002 index 843c06b..78bf551 100644
1003 --- a/netstat.c
1004 +++ b/netstat.c
1005 @@ -150,6 +150,7 @@ int flag_exp = 1;
1006 int flag_prg = 0;
1007 int flag_arg = 0;
1008 int flag_ver = 0;
1009 +int flag_wid = 0;
1010
1011 FILE *procinfo;
1012
1013 @@ -780,7 +781,7 @@ static void tcp_do_one(int lnr, const char *line)
1014 get_sname(htons(local_port), "tcp",
1015 flag_not & FLAG_NUM_PORT));
1016
1017 - if ((strlen(local_addr) + strlen(buffer)) > 22)
1018 + if (!flag_wid && ((strlen(local_addr) + strlen(buffer)) > 22))
1019 local_addr[22 - strlen(buffer)] = '\0';
1020
1021 strcat(local_addr, ":");
1022 @@ -789,7 +790,7 @@ static void tcp_do_one(int lnr, const char *line)
1023 snprintf(buffer, sizeof(buffer), "%s",
1024 get_sname(htons(rem_port), "tcp", flag_not & FLAG_NUM_PORT));
1025
1026 - if ((strlen(rem_addr) + strlen(buffer)) > 22)
1027 + if (!flag_wid && ((strlen(rem_addr) + strlen(buffer)) > 22))
1028 rem_addr[22 - strlen(buffer)] = '\0';
1029
1030 strcat(rem_addr, ":");
1031 @@ -935,7 +936,7 @@ static void udp_do_one(int lnr, const char *line)
1032 snprintf(buffer, sizeof(buffer), "%s",
1033 get_sname(htons(local_port), "udp",
1034 flag_not & FLAG_NUM_PORT));
1035 - if ((strlen(local_addr) + strlen(buffer)) > 22)
1036 + if (!flag_wid && ((strlen(local_addr) + strlen(buffer)) > 22))
1037 local_addr[22 - strlen(buffer)] = '\0';
1038 strcat(local_addr, ":");
1039 strncat(local_addr, buffer, sizeof(local_addr));
1040 @@ -945,7 +946,7 @@ static void udp_do_one(int lnr, const char *line)
1041 get_sname(htons(rem_port), "udp", flag_not & FLAG_NUM_PORT));
1042 safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
1043 flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
1044 - if ((strlen(rem_addr) + strlen(buffer)) > 22)
1045 + if (!flag_wid && ((strlen(rem_addr) + strlen(buffer)) > 22))
1046 rem_addr[22 - strlen(buffer)] = '\0';
1047 strcat(rem_addr, ":");
1048 strncat(rem_addr, buffer, sizeof(rem_addr));
1049 @@ -1059,7 +1060,7 @@ static void raw_do_one(int lnr, const char *line)
1050 flag_not & FLAG_NUM_PORT));
1051 safe_strncpy(local_addr, ap->sprint((struct sockaddr *) &localaddr,
1052 flag_not & FLAG_NUM_HOST), sizeof(local_addr));
1053 - if ((strlen(local_addr) + strlen(buffer)) > 22)
1054 + if (!flag_wid && ((strlen(local_addr) + strlen(buffer)) > 22))
1055 local_addr[22 - strlen(buffer)] = '\0';
1056 strcat(local_addr, ":");
1057 strncat(local_addr, buffer, sizeof(local_addr));
1058 @@ -1069,7 +1070,7 @@ static void raw_do_one(int lnr, const char *line)
1059 get_sname(htons(rem_port), "raw", flag_not & FLAG_NUM_PORT));
1060 safe_strncpy(rem_addr, ap->sprint((struct sockaddr *) &remaddr,
1061 flag_not & FLAG_NUM_HOST), sizeof(rem_addr));
1062 - if ((strlen(rem_addr) + strlen(buffer)) > 22)
1063 + if (!flag_wid && ((strlen(rem_addr) + strlen(buffer)) > 22))
1064 rem_addr[22 - strlen(buffer)] = '\0';
1065 strcat(rem_addr, ":");
1066 strncat(rem_addr, buffer, sizeof(rem_addr));
1067 @@ -1531,6 +1532,7 @@ static void usage(void)
1068 fprintf(stderr, _(" --numeric-hosts don't resolve host names\n"));
1069 fprintf(stderr, _(" --numeric-ports don't resolve port names\n"));
1070 fprintf(stderr, _(" --numeric-users don't resolve user names\n"));
1071 + fprintf(stderr, _(" -W, --wide don't truncate host names\n"));
1072 fprintf(stderr, _(" -N, --symbolic resolve hardware names\n"));
1073 fprintf(stderr, _(" -e, --extend display other/more information\n"));
1074 fprintf(stderr, _(" -p, --programs display PID/Program name for sockets\n"));
1075 @@ -1580,6 +1582,7 @@ int main
1076 {"numeric-hosts", 0, 0, '!'},
1077 {"numeric-ports", 0, 0, '@'},
1078 {"numeric-users", 0, 0, '#'},
1079 + {"wide", 0, 0, 'W'},
1080 {"symbolic", 0, 0, 'N'},
1081 {"cache", 0, 0, 'C'},
1082 {"fib", 0, 0, 'F'},
1083 @@ -1595,7 +1598,7 @@ int main
1084 getroute_init(); /* Set up AF routing support */
1085
1086 afname[0] = '\0';
1087 - while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuVv?wxl64", longopts, &lop)) != EOF)
1088 + while ((i = getopt_long(argc, argv, "MCFA:acdegphinWNorstuVv?wxl64", longopts, &lop)) != EOF)
1089 switch (i) {
1090 case -1:
1091 break;
1092 @@ -1651,6 +1654,9 @@ int main
1093 case '#':
1094 flag_not |= FLAG_NUM_USER;
1095 break;
1096 + case 'W':
1097 + flag_wid++;
1098 + break;
1099 case 'N':
1100 flag_not |= FLAG_SYM;
1101 break;
1102 --
1103 1.5.5
1104
1105
1106
1107
1108 --
1109 gentoo-commits@l.g.o mailing list