All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hauke Mehrtens <hauke@hauke-m.de>
To: backports@vger.kernel.org
Cc: johannes@sipsolutions.net,
	Johannes Berg <johannes.berg@intel.com>,
	Hauke Mehrtens <hauke@hauke-m.de>
Subject: [PATCH 2/8] backports: skbuff: add skb_list_walk_safe() and skb_mark_not_on_list()
Date: Sun, 19 Apr 2020 19:10:33 +0200	[thread overview]
Message-ID: <20200419171039.17268-3-hauke@hauke-m.de> (raw)
In-Reply-To: <20200419171039.17268-1-hauke@hauke-m.de>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 backport/backport-include/linux/skbuff.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

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 */
-- 
2.20.1

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

  parent reply	other threads:[~2020-04-19 17:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-19 17:10 [PATCH 0/8] backports: Update to version 5.6.5 Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 1/8] backports: add linux/units.h Hauke Mehrtens
2020-04-19 17:10 ` Hauke Mehrtens [this message]
2020-04-19 17:10 ` [PATCH 3/8] backports: netlink: fix nla_validate_nested() Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 4/8] backports: patches: Refresh on kernel 5.6.5 Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 5/8] backports: patches: handle txqueue parameter in ndo_tx_timeout Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 6/8] backports: rcupdate: Add rcu_replace_pointer Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 7/8] backports: fs: Adapt struct proc_ops Hauke Mehrtens
2020-04-19 17:10 ` [PATCH 8/8] patches: patches: Restrict MTU changes to struct net_device Hauke Mehrtens
2020-04-20  7:50 ` [PATCH 0/8] backports: Update to version 5.6.5 Johannes Berg

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=20200419171039.17268-3-hauke@hauke-m.de \
    --to=hauke@hauke-m.de \
    --cc=backports@vger.kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.