Skip to content

Commit 1fe323a

Browse files
lxindavem330
authored andcommitted
sctp: use event->chunk when it's valid
Commit 52253db ("sctp: also point GSO head_skb to the sk when it's available") used event->chunk->head_skb to get the head_skb in sctp_ulpevent_set_owner(). But at that moment, the event->chunk was NULL, as it cloned the skb in sctp_ulpevent_make_rcvmsg(). Therefore, that patch didn't really work. This patch is to move the event->chunk initialization before calling sctp_ulpevent_receive_data() so that it uses event->chunk when it's valid. Fixes: 52253db ("sctp: also point GSO head_skb to the sk when it's available") Signed-off-by: Xin Long <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bbec780 commit 1fe323a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/sctp/ulpevent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,14 +702,14 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
702702
*/
703703
sctp_ulpevent_init(event, 0, skb->len + sizeof(struct sk_buff));
704704

705-
sctp_ulpevent_receive_data(event, asoc);
706-
707705
/* And hold the chunk as we need it for getting the IP headers
708706
* later in recvmsg
709707
*/
710708
sctp_chunk_hold(chunk);
711709
event->chunk = chunk;
712710

711+
sctp_ulpevent_receive_data(event, asoc);
712+
713713
event->stream = ntohs(chunk->subh.data_hdr->stream);
714714
event->ssn = ntohs(chunk->subh.data_hdr->ssn);
715715
event->ppid = chunk->subh.data_hdr->ppid;

0 commit comments

Comments
 (0)