diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-20 04:07:09 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 1999-08-20 04:07:09 +0000 |
commit | 49388049d3cfae3d5ad1ec260a917bf9737f3c71 (patch) | |
tree | a590141373494da37deeaaa399ad07c1343ac588 /wiretap/iptrace.c | |
parent | aae22bd2279292449e74a10b6887b034a3b17a78 (diff) |
Made iptrace wiretap module return error on partial packets, instead of
expecting it as normal. Added paragraph about iptrace oddities to README.
I also added a section to the README about how to report bugs.
svn path=/trunk/; revision=519
Diffstat (limited to 'wiretap/iptrace.c')
-rw-r--r-- | wiretap/iptrace.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/wiretap/iptrace.c b/wiretap/iptrace.c index 5c35a06fc5..381d22b0d2 100644 --- a/wiretap/iptrace.c +++ b/wiretap/iptrace.c @@ -1,6 +1,6 @@ /* iptrace.c * - * $Id: iptrace.c,v 1.6 1999/08/19 05:31:37 guy Exp $ + * $Id: iptrace.c,v 1.7 1999/08/20 04:07:09 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu> @@ -75,12 +75,10 @@ static int iptrace_read(wtap *wth, int *err) *err = errno; return -1; } - /* because of the way we have to kill the iptrace command, - * the existence of a partial header or packet is probable, - * and we should not complain about it. Simply return - * quietly and pretend that the trace file ended on - * a packet boundary - */ + if (bytes_read != 0) { + *err = WTAP_ERR_SHORT_READ; + return -1; + } return 0; } @@ -94,15 +92,6 @@ static int iptrace_read(wtap *wth, int *err) packet_size, wth->fh); if (bytes_read != packet_size) { - /* don't complain about a partial packet. Just - * pretend that we reached the end of the file - * normally. If, however, there was a read error - * because of some other reason, complain - * - * XXX - this was returning -1 even on a partial - * packet; should we return 0 on a partial packet, - * so that "wtap_loop()" quits and reports success? - */ if (ferror(wth->fh)) *err = errno; else |