backports.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: backports@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 2/3] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()
Date: Thu, 12 Mar 2020 16:59:12 +0100	[thread overview]
Message-ID: <20200312165913.0915e5af7240.I35d006756fc2f08463616f8717f02d20ac80153d@changeid> (raw)
In-Reply-To: <20200312165913.e9a97c70de23.Idb983599e482232ae3cfc3328e837e8a9bf1af7a@changeid>

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
 
 #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 */
-- 
2.24.1

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

  reply	other threads:[~2020-03-12 15:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 15:59 [PATCH 1/3] backports: add linux/units.h Johannes Berg
2020-03-12 15:59 ` Johannes Berg [this message]
2020-03-20 23:38   ` [PATCH 2/3] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list() Hauke Mehrtens
2020-03-12 15:59 ` [PATCH 3/3] backports: netlink: fix nla_validate_nested() Johannes Berg
2020-03-20 23:39 ` [PATCH 1/3] backports: add linux/units.h Hauke Mehrtens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200312165913.0915e5af7240.I35d006756fc2f08463616f8717f02d20ac80153d@changeid \
    --to=johannes@sipsolutions.net \
    --cc=backports@vger.kernel.org \
    --cc=johannes.berg@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).