diff options
author | Johannes Berg <johannes.berg@intel.com> | 2020-03-12 16:59:12 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2020-04-19 17:51:52 +0200 |
commit | e26f1313619084dfd81be46ca209ca38d053161f (patch) | |
tree | e21f120c1fa4e6f3ff65028b344acaa5d30be79c | |
parent | 0c85d30f1420ba0535dc4f47a9c4c5ae926e2d8b (diff) | |
download | backports-e26f1313619084dfd81be46ca209ca38d053161f.tar.gz |
backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[Do not add skb_mark_not_on_list() on kernel > 4.19.10]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/skbuff.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h index 42b048ad..3ed990d0 100644 --- a/backport/backport-include/linux/skbuff.h +++ b/backport/backport-include/linux/skbuff.h @@ -378,6 +378,13 @@ static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_) { return list_->next; } + +#if !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0) +static inline void skb_mark_not_on_list(struct sk_buff *skb) +{ + skb->next = NULL; +} +#endif /* 4.19.10 <= x < 4.20 */ #endif #if LINUX_VERSION_IS_LESS(4,11,0) @@ -406,4 +413,10 @@ static inline void nf_reset_ct(struct sk_buff *skb) } #endif +#ifndef skb_list_walk_safe +#define skb_list_walk_safe(first, skb, next_skb) \ + for ((skb) = (first), (next_skb) = (skb) ? (skb)->next : NULL; (skb); \ + (skb) = (next_skb), (next_skb) = (skb) ? (skb)->next : NULL) +#endif + #endif /* __BACKPORT_SKBUFF_H */ |