diff mbox series

[2/3] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()

Message ID 20200312165913.0915e5af7240.I35d006756fc2f08463616f8717f02d20ac80153d@changeid (mailing list archive)
State New, archived
Headers show
Series [1/3] backports: add linux/units.h | expand

Commit Message

Johannes Berg March 12, 2020, 3:59 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 backport/backport-include/linux/skbuff.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Hauke Mehrtens March 20, 2020, 11:38 p.m. UTC | #1
On 3/12/20 4:59 PM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  backport/backport-include/linux/skbuff.h | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
> index 8af34146432e..3b63ce76a0b5 100644
> --- a/backport/backport-include/linux/skbuff.h
> +++ b/backport/backport-include/linux/skbuff.h
> @@ -380,6 +380,11 @@ static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_)
>  {
>  	return list_->next;
>  }
> +
> +static inline void skb_mark_not_on_list(struct sk_buff *skb)
> +{
> +	skb->next = NULL;
> +}
>  #endif

skb_mark_not_on_list() was backported to kernel 4.19.10 and this
definition conflicts.

I added this around it:
#if !LINUX_VERSION_IN_RANGE(4,19,10, 4,20,0)

Hauke

--
To unsubscribe from this list: send the line "unsubscribe backports" in
diff mbox series

Patch

diff --git a/backport/backport-include/linux/skbuff.h b/backport/backport-include/linux/skbuff.h
index 8af34146432e..3b63ce76a0b5 100644
--- a/backport/backport-include/linux/skbuff.h
+++ b/backport/backport-include/linux/skbuff.h
@@ -380,6 +380,11 @@  static inline struct sk_buff *__skb_peek(const struct sk_buff_head *list_)
 {
 	return list_->next;
 }
+
+static inline void skb_mark_not_on_list(struct sk_buff *skb)
+{
+	skb->next = NULL;
+}
 #endif
 
 #if LINUX_VERSION_IS_LESS(4,11,0)
@@ -408,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 */