[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: questions on ip_input.c
hi,
sizeof(struct iphdr) can be different from iph->ihl*4, one difference is
this
HTH
Amit
"bunty " <bunty123_4@xxxxxxxxxxxxxx>@nl.linux.org on 06/03/2004 08:38:04 PM
Please respond to "bunty " <bunty123_4@xxxxxxxxxxxxxx>
Sent by: kernelnewbies-bounce@xxxxxxxxxxxx
To: kernelnewbies@xxxxxxxxxxxx
cc:
Subject: questions on ip_input.c
hello ,
what is the difference between following two fragments of code?
---------------------------------------------------------------
if (!pskb_may_pull(skb, sizeof(struct iphdr)))
goto inhdr_error;
iph = skb->nh.iph;
-----------------------------------------------------------------
if (!pskb_may_pull(skb, iph->ihl*4))
goto inhdr_error;
iph = skb->nh.iph;
-----------------------------------------------------------------
Also
/* Our transport medium may have padded the buffer out. Now we know it
* is IP we can trim to the true length of the frame.
* Note this now means skb->len holds ntohs(iph->tot_len).
*/
if (skb->len > len) {
__pskb_trim(skb, len);
if (skb->ip_summed == CHECKSUM_HW)
skb->ip_summed = CHECKSUM_NONE;
can anybody explain me in which condition trim is required ot transport
layer
to pad zeros?
regards,
parag.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/