On Mon, 10 Mar 2003, Duncan Sands wrote:

> 
> Spotted in atm.c:
> 
>         /* Skip the junk bytes at the beginning */
>         if(!tmp) {
>                 src    += tmp;
>                 length -= tmp;
>         }
> 
> Hmmm.
> 
> Duncan.
> 
I remember this one - but I hadn't noticed the !

Previously the code did something like:

src = atm_cells;
dst = atm5_frames + *cur_pos;

<calculate tmp and adjust src and length>

src = atm_cells;
dst = atm5_frames + *cur_pos;

So basically the code just used to trim the length.
I remember saying that the comment didn't match the code.


This could explain the CRC errors if the crud really is at the beginning
of the buffer. I think you will usually get away with this if the
crud is at the end although you will probably get CRC errors.


So, IMO,

if(!tmp) should be if(tmp)

and possibly the src+=tmp should be removed - people getting CRC errors
should try with and without so we can narrow this one down.

Regards,

Tim.


-- 
God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t," 
and there was light.

     http://tjw.hn.org/      http://www.locofungus.btinternet.co.uk/



Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se désinscrire : mailto:[EMAIL PROTECTED]

        

Reply via email to