Tim Woodall ([EMAIL PROTECTED]) wrote:
>
> [...]
> In aal5_frame_from_atm_cells() there appears to be some confusion:
>
> first there is the if(tmp > 0) { src = atm_cells + tmp; ... } and
> then immediately after the if there is src=atm_cells;
>
> This doesn't make sense to me :-)
>
I'll try to understand what you're telling us :-)
(And fix it in the appropriate way if necessary)
> The other thing that looks a bit worrying is:
>
> in aal5_frame_dec we (effectively) pass in the "joined up" frame
> and a pointer to the end of it.
>
> We use ((frame[length-6]<<8) | frame[length-5]) to get the length
> of the frame.
>
> But..............
>
> If the frame is corrupted but the CRC check has succeeded -
> unlikely but not impossible - then real_length could be complete
> rubbish.
>
> IIRC, CRC-n checks are guaranteed to detect all n-1 bit errors
> but, as I suspect most errors are due to a missing cell, most of our
> errors are likely to be >31 bits.
> (I see very few CRC errors and I think there is about a 1 in 2^32
> chance of a bad frame passing the crc check if a cell is missing
> so I don't think it is likely that this is what happened to me
> today)
>
> I think that, after the calculation of real_length there should be a
> check that real_length<length && real_length+ATM_CELL_DATA_SIZE<length.
>
> (There are probably constants of 2 or 8 needed in the above somewhere
> I _think_ the correct values are:
> if(real_length>length-8 || real_length<=length-8-ATM_CELL_DATA_SIZE)
> return -1;
> BICBW.)
>
I'll try to change things a bit to take care of this situation.
>
> Finally - a style thing :-)
>
> pppoa3.c line 841.
>
> pointers should not be cast to ints. ever!
>
> length = sizeof lbuf - (unused_cells - lbuf);
>
> is perfectly well defined on all systems as unused cells points into
> the lbuf array and you won't get horrible problems when someone tries
> to port to a platform where sizeof(unsigned char*) > sizeof(int)
>
Yeah, stupid "error"... sorry :\
Btw it has been fixed in cvs
> Tim.
>
>
> --
> God said, "div D = rho, div B = 0, curl E = - @B/@t, curl H = J + @D/@t,"
> and there was light.
>
And what do you think about Relativity ?
How has the apple fallen from the knowledge tree ? ;-)
--
Edouard Gomez
Liste de diffusion modem ALCATEL SpeedTouch USB
Pour se d�sinscrire : mailto:[EMAIL PROTECTED]?subject=unsubscribe