aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/skbuff.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r--include/linux/skbuff.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2b0a30a6e31c..4355129fff91 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -463,6 +463,15 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1,
463 return delta_us; 463 return delta_us;
464} 464}
465 465
466static inline bool skb_mstamp_after(const struct skb_mstamp *t1,
467 const struct skb_mstamp *t0)
468{
469 s32 diff = t1->stamp_jiffies - t0->stamp_jiffies;
470
471 if (!diff)
472 diff = t1->stamp_us - t0->stamp_us;
473 return diff > 0;
474}
466 475
467/** 476/**
468 * struct sk_buff - socket buffer 477 * struct sk_buff - socket buffer
@@ -1215,7 +1224,7 @@ static inline int skb_cloned(const struct sk_buff *skb)
1215 1224
1216static inline int skb_unclone(struct sk_buff *skb, gfp_t pri) 1225static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
1217{ 1226{
1218 might_sleep_if(pri & __GFP_WAIT); 1227 might_sleep_if(gfpflags_allow_blocking(pri));
1219 1228
1220 if (skb_cloned(skb)) 1229 if (skb_cloned(skb))
1221 return pskb_expand_head(skb, 0, 0, pri); 1230 return pskb_expand_head(skb, 0, 0, pri);
@@ -1299,7 +1308,7 @@ static inline int skb_shared(const struct sk_buff *skb)
1299 */ 1308 */
1300static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri) 1309static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri)
1301{ 1310{
1302 might_sleep_if(pri & __GFP_WAIT); 1311 might_sleep_if(gfpflags_allow_blocking(pri));
1303 if (skb_shared(skb)) { 1312 if (skb_shared(skb)) {
1304 struct sk_buff *nskb = skb_clone(skb, pri); 1313 struct sk_buff *nskb = skb_clone(skb, pri);
1305 1314
@@ -1335,7 +1344,7 @@ static inline struct sk_buff *skb_share_check(struct sk_buff *skb, gfp_t pri)
1335static inline struct sk_buff *skb_unshare(struct sk_buff *skb, 1344static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
1336 gfp_t pri) 1345 gfp_t pri)
1337{ 1346{
1338 might_sleep_if(pri & __GFP_WAIT); 1347 might_sleep_if(gfpflags_allow_blocking(pri));
1339 if (skb_cloned(skb)) { 1348 if (skb_cloned(skb)) {
1340 struct sk_buff *nskb = skb_copy(skb, pri); 1349 struct sk_buff *nskb = skb_copy(skb, pri);
1341 1350
@@ -2708,7 +2717,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb,
2708 if (skb->ip_summed == CHECKSUM_COMPLETE) 2717 if (skb->ip_summed == CHECKSUM_COMPLETE)
2709 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); 2718 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
2710 else if (skb->ip_summed == CHECKSUM_PARTIAL && 2719 else if (skb->ip_summed == CHECKSUM_PARTIAL &&
2711 skb_checksum_start_offset(skb) <= len) 2720 skb_checksum_start_offset(skb) < 0)
2712 skb->ip_summed = CHECKSUM_NONE; 2721 skb->ip_summed = CHECKSUM_NONE;
2713} 2722}
2714 2723