Garrett D'Amore wrote:

> Erik Nordmark wrote:
>
>> [EMAIL PROTECTED] wrote:
>>
>>  
>>
>>> Everytime the networking code wants to know how long the
>>> packet is, it is necessary to call msgdsize() - or similar.
>>> In the best cast, this requires a simple bit of pointer arithmetic,
>>> but otherwise becomes a linked list walk.  Costly.
>>>     
>>
>>
>> I think ipha_length works just fine.
>> The only exception is where IP needs to verify that the length of the 
>> received packet is consistent with ipha_length.
>>   
>
>
> No, it doesn't.
>
> A lot of device drivers do msgdsize.  Some (neptune, I'm looking at 
> you!) call it *a lot* (repeatedly) on the same packet.
>
> It would be very, very handy to have to full packet (maybe I mean 
> ethernet frame here) length pre-calculated.


And in the MAC layer (and others) where we either don't know if
we've got an IP packet or we're dealing with something that isn't
an IPv4 (or IPv6) packet and thus we don't know if we can reach
in and grab a length.  There's a function of similar name to msgdsize
in the clearview gate (if not elsewhere) that suggests a similar
problem but I haven't tracked that one down yet.

Darren

_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to