LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Explanation sought for a check in ip_finish_output2() function (https://www.linuxquestions.org/questions/linux-networking-3/explanation-sought-for-a-check-in-ip_finish_output2-function-556513/)

Pankaj Srivastava 05-24-2007 08:52 PM

Explanation sought for a check in ip_finish_output2() function
 
Could someone please explain why there is a following check in ip_finish_output2() function as sk_buff in question should have already headroom space accounted for in the original allocation. In what scenario we can hit this leg.


/* Be paranoid, rather than too clever. */
if (unlikely(skb_headroom(skb) < hh_len && dev->hard_header)) {
struct sk_buff *skb2;

skb2 = skb_realloc_headroom(skb, LL_RESERVED_SPACE(dev));
if (skb2 == NULL) {
kfree_skb(skb);
return -ENOMEM;
}
if (skb->sk)
skb_set_owner_w(skb2, skb->sk);
kfree_skb(skb);
skb = skb2;
}


All times are GMT -5. The time now is 09:46 PM.