Thread (16 messages) 16 messages, 4 authors, 2005-02-09

Re: [PATCH] NETLINK: Use SKB_MAXORDER to calculate NLMSG_GOODSIZE

From: Thomas Graf <tgraf@suug.ch>
Date: 2005-02-07 13:28:30

quoted
quoted
 		struct sk_buff *nskb;
 		int header = skb_headroom(skb);
-		int copy = (PAGE_SIZE - sizeof(struct sk_buff) -
-			    sizeof(struct skb_shared_info) - header - 31)&~15;
+		int copy = SKB_MAX_ORDER(header + 31, 0);
 
 		/* Too big header? This can happen with IPv6. */
 		if (copy < 0)
Sorry, this is incomplete, we should refetch copy via (skb->end - skb->head) after
allocating it.  I have to think some more about this first. ;-)
I don't understand, if we alloc_skb(copy) we are guarenteed to have
"copy" bytes available in the SKB data area.
Yes but don't we waste space in the headroom of the new skb iff the
headroom of the original skb is no aligned to SKB_DATA_ALIGN?

I'll post a new patch without the anyway though.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help