diff options
author | David Miller <davem@davemloft.net> | 2019-04-11 18:01:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-12 00:33:31 -0400 |
commit | 925b93742263f3139856fcab944c165cfabe39f4 (patch) | |
tree | ab0ef5995357496691e216fca12da1ef16248b47 /net/sctp/ulpqueue.c | |
parent | 0eff1052438c360c21aef01cc689ef54ee528af7 (diff) |
sctp: Always pass skbs on a list to sctp_ulpq_tail_event().
This way we can simplify the logic and remove assumptions
about the implementation of skb lists.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/ulpqueue.c')
-rw-r--r-- | net/sctp/ulpqueue.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c index 0fecc1fb4ab7..b22f558adc49 100644 --- a/net/sctp/ulpqueue.c +++ b/net/sctp/ulpqueue.c | |||
@@ -738,19 +738,19 @@ void sctp_ulpq_reasm_flushtsn(struct sctp_ulpq *ulpq, __u32 fwd_tsn) | |||
738 | static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq) | 738 | static void sctp_ulpq_reasm_drain(struct sctp_ulpq *ulpq) |
739 | { | 739 | { |
740 | struct sctp_ulpevent *event = NULL; | 740 | struct sctp_ulpevent *event = NULL; |
741 | struct sk_buff_head temp; | ||
742 | 741 | ||
743 | if (skb_queue_empty(&ulpq->reasm)) | 742 | if (skb_queue_empty(&ulpq->reasm)) |
744 | return; | 743 | return; |
745 | 744 | ||
746 | while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { | 745 | while ((event = sctp_ulpq_retrieve_reassembled(ulpq)) != NULL) { |
747 | /* Do ordering if needed. */ | 746 | struct sk_buff_head temp; |
748 | if (event->msg_flags & MSG_EOR) { | 747 | |
749 | skb_queue_head_init(&temp); | 748 | skb_queue_head_init(&temp); |
750 | __skb_queue_tail(&temp, sctp_event2skb(event)); | 749 | __skb_queue_tail(&temp, sctp_event2skb(event)); |
751 | 750 | ||
751 | /* Do ordering if needed. */ | ||
752 | if (event->msg_flags & MSG_EOR) | ||
752 | event = sctp_ulpq_order(ulpq, event); | 753 | event = sctp_ulpq_order(ulpq, event); |
753 | } | ||
754 | 754 | ||
755 | /* Send event to the ULP. 'event' is the | 755 | /* Send event to the ULP. 'event' is the |
756 | * sctp_ulpevent for very first SKB on the temp' list. | 756 | * sctp_ulpevent for very first SKB on the temp' list. |
@@ -1082,6 +1082,10 @@ void sctp_ulpq_partial_delivery(struct sctp_ulpq *ulpq, | |||
1082 | event = sctp_ulpq_retrieve_first(ulpq); | 1082 | event = sctp_ulpq_retrieve_first(ulpq); |
1083 | /* Send event to the ULP. */ | 1083 | /* Send event to the ULP. */ |
1084 | if (event) { | 1084 | if (event) { |
1085 | struct sk_buff_head temp; | ||
1086 | |||
1087 | skb_queue_head_init(&temp); | ||
1088 | __skb_queue_tail(&temp, sctp_event2skb(event)); | ||
1085 | sctp_ulpq_tail_event(ulpq, event); | 1089 | sctp_ulpq_tail_event(ulpq, event); |
1086 | sctp_ulpq_set_pd(ulpq); | 1090 | sctp_ulpq_set_pd(ulpq); |
1087 | return; | 1091 | return; |