Re: Bug fix (not sure how to submit)

Patrice Fournier <[email protected]> Sat, 03 Jul 2010 07:49:22 -0400
Newsgroups gmane.comp.telephony.fax.hylafax.devel
Message-ID <[email protected]>
Brian,

Brian Postow wrote:

> We had a problem dealing with a buggy FOIP box that would get the T30 frame, checked the CRC, found that it was correct, and then turned it into T38 packets and sent them to our computer. However there were two problems: 1) the FOIP box lost packets. and 2) T38 doesn't pass the CRC, it just says "yup, the CRC was correct on this end" and so, Hylafax got a short frame, which ends up with a broken TIFF file.
> 
> We fixed this problem in faxd/Class1Recv.c++ by in additon to checking the CRC, checking the frame length:
> 
> In faxd/Class1Recv.c++, in recvPageECMData line 1373
> 	if (frame.checkCRC()) 
>     becomes
>         if (frame.checkCRC()  && frame.getLength() == frameSize+6) 
> 
> This is in the 6.0.4 version... 

The problem I have with this patch is that recvECMFrame() can return a
valid frame with a length different to frameSize+6 (but this should only be 
valid if it's the last frame). The following comment appears in the code of 
that function:

/*
  * The HDLC frame was terminated early by a flag.  T.30 A.3.5 states that
  * frame size cannot change during one page, and T.4 A.3.6.2 seems to provide
  * for padding in order to get that last frame on a block to always line up
  * on a byte and frame boundary.  However, the NOTE 2 there seemse to give
  * leniency to that requirement, and in fact many senders will send short
  * frames on the last frame of a block.  So we run a couple of additional
  * checks here (in addition to FCS checking) to limit the remote chance
  * of FCS actually checking out on corrupt data (although that may be very
  * remote indeed).  We don't do these "trailing flag" tests on normal-sized
  * frames because we deliberately don't look for a trailing flag when we
  * get enough data.
  */

Could you show us a log showing the problem with HDLC trace enabled? (Setting 
SessionLog to 0xFFFFFF would do it)


Thanks,

-- 
Patrice Fournier
iFAX Solutions, Inc.
http://www.ifax.com/



____________________ HylaFAX(tm) Developers Mailing List ____________________
  To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe [email protected] < /dev/null