Subject: pkg/8292: etherreal aborts with live capture file
To: None <gnats-bugs@gnats.netbsd.org>
From: Wolfgang Rupprecht <wolfgang@wsrcc.com>
List: netbsd-bugs
Date: 08/29/1999 16:19:55
>Number:         8292
>Category:       pkg
>Synopsis:       etherreal aborts with live capture file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Aug 29 15:20:01 1999
>Last-Modified:
>Originator:     Wolfgang Rupprecht
>Organization:
W S Rupprecht Computer Consulting, Fremont CA
>Release:        NetBSD-current 19990826
>Environment:
	
System: NetBSD capsicum.wsrcc.com 1.4K NetBSD 1.4K (WSRCC) #0: Thu Aug 26 16:46:07 PDT 1999 root@capsicum.wsrcc.com:/v/src/netbsd/NetBSD-current/usr/src/sys/arch/i386/compile/WSRCC i386


>Description:
	ethereal aborts when run on a file that is still being appended to
	by tcpdump.

>How-To-Repeat:
	tcpdump -w /tmp/x.tcpdump
	<wait for file to become non-zero>
	ethereal -r /tmp/x.tcpdump

>Fix:


diff -u /v/obj/net/ethereal/work/ethereal-0.7.1/wiretap/libpcap.c.\~1\~ /v/obj/net/ethereal/work/ethereal-0.7.1/wiretap/libpcap.c
--- /v/obj/net/ethereal/work/ethereal-0.7.1/wiretap/libpcap.c.~1~	Wed Jul 28 20:44:56 1999
+++ /v/obj/net/ethereal/work/ethereal-0.7.1/wiretap/libpcap.c	Sun Aug 29 15:03:22 1999
@@ -203,12 +203,14 @@
 			packet_size, wth->fh);
 
 	if (bytes_read != packet_size) {
+#if 0				/* g_error is fatal.  This error isn not. -wsr */
 		if (ferror(wth->fh)) {
 			g_error("pcap_read: fread for data: read error\n");
 		} else {
 			g_error("pcap_read: fread for data: %d bytes out of %d",
 				bytes_read, packet_size);
 		}
+#endif
 		return -1;
 	}
 

Diff finished at Sun Aug 29 15:15:35
			
>Audit-Trail:
>Unformatted:
2067/tcp # Data Link Switch Write Port Number files/patch-sum: $NetBSD$ MD5 (patch-aa) = b8c66124e77a15af902e3101411f216b MD5 (patch-ab) = 15c32650dc038b42582c885b66240ff1 >Audit-Trail: >Unformatted: