# \[PATCH net\] use skb\_end\_offset() in skb\_try\_coalesce()

- From: Weiping Pan \<hidden\>
- Date: 2012-09-29 06:14:05 
- List: netdev
- Page: https://ratatoskr.run/netdev/2012/09/10905228
- Thread: https://ratatoskr.run/netdev/2012/09/10905228/t.md

```text
Commit ec47ea824774(skb: Add inline helper for getting the skb end offset from
head) introduces this helper function, skb_end_offset(),
we should make use of it.

Signed-off-by: Weiping Pan <redacted>
---
 net/core/skbuff.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index e33ebae..86f040a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3488,8 +3488,7 @@ bool skb_try_coalesce(struct sk_buff *to, struct sk_buff *from,
 		    skb_shinfo(from)->nr_frags > MAX_SKB_FRAGS)
 			return false;
 
-		delta = from->truesize -
-			SKB_TRUESIZE(skb_end_pointer(from) - from->head);
+		delta = from->truesize - SKB_TRUESIZE(skb_end_offset(from));
 	}
 
 	WARN_ON_ONCE(delta < len);
-- 
1.7.4.4
```
