Skip to contentSkip to conversation

: Make SCTP use SKB queue interfaces.

PATCH New David Miller 1 participant 1 message Sep 23, 2008

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 1/1 : Make SCTP use SKB queue interfaces.

Instead of pretending that SKB lists are already using struct list_head :-/

sctp: Use skb_queue_walk_safe() and skb_queue_split_tail_init().

---
 include/net/sctp/sctp.h |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
include/net/sctp/sctp.h +2 -8
index 17b932b..703305d 100644
@@ -406,10 +406,7 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id);
 
 /* A macro to walk a list of skbs.  */
 #define sctp_skb_for_each(pos, head, tmp) \
-for (pos = (head)->next;\
-     tmp = (pos)->next, pos != ((struct sk_buff *)(head));\
-     pos = tmp)
-
+	skb_queue_walk_safe(head, pos, tmp)
 
 /* A helper to append an entire skb list (list) to another (head). */
 static inline void sctp_skb_list_tail(struct sk_buff_head *list,
@@ -420,10 +417,7 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
 	sctp_spin_lock_irqsave(&head->lock, flags);
 	sctp_spin_lock(&list->lock);
 
-	list_splice((struct list_head *)list, (struct list_head *)head->prev);
-
-	head->qlen += list->qlen;
-	list->qlen = 0;
+	skb_queue_splice_tail_init(list, head);
 
 	sctp_spin_unlock(&list->lock);
 	sctp_spin_unlock_irqrestore(&head->lock, flags);
Signature · 1 line
1.5.6.5