All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net: skb_trim explicitely check the linearity instead of data_len
@ 2011-05-22  5:46 emmanuel.grumbach
  2011-05-23  1:02 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: emmanuel.grumbach @ 2011-05-22  5:46 UTC (permalink / raw)
  To: davem, netdev; +Cc: Emmanuel Grumbach

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

The purpose of the check on data_len is to check linearity, so use the inline
helper for this. No overhead and more explicit.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
 include/linux/skbuff.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index bf221d6..a4f680c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1439,7 +1439,7 @@ extern int ___pskb_trim(struct sk_buff *skb, unsigned int len);
 
 static inline void __skb_trim(struct sk_buff *skb, unsigned int len)
 {
-	if (unlikely(skb->data_len)) {
+	if (unlikely(skb_is_nonlinear(skb))) {
 		WARN_ON(1);
 		return;
 	}
-- 
1.7.1

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: skb_trim explicitely check the linearity instead of data_len
  2011-05-22  5:46 [PATCH] net: skb_trim explicitely check the linearity instead of data_len emmanuel.grumbach
@ 2011-05-23  1:02 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-05-23  1:02 UTC (permalink / raw)
  To: emmanuel.grumbach; +Cc: netdev

From: emmanuel.grumbach@intel.com
Date: Sun, 22 May 2011 08:46:09 +0300

> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> 
> The purpose of the check on data_len is to check linearity, so use the inline
> helper for this. No overhead and more explicit.
> 
> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-23  1:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-22  5:46 [PATCH] net: skb_trim explicitely check the linearity instead of data_len emmanuel.grumbach
2011-05-23  1:02 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.