Commit 1fe323aa authored by Xin Long's avatar Xin Long Committed by David S. Miller
Browse files

sctp: use event->chunk when it's valid

Commit 52253db9 ("sctp: also point GSO head_skb to the sk when
it's available") used event->chunk->head_skb to get the head_skb in

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

This patch is to move the event->chunk initialization before calling
sctp_ulpevent_receive_data() so that it uses event->chunk when it's

Fixes: 52253db9

 ("sctp: also point GSO head_skb to the sk when it's available")
Signed-off-by: default avatarXin Long <>
Acked-by: default avatarMarcelo Ricardo Leitner <>
Acked-by: default avatarNeil Horman <>
Signed-off-by: default avatarDavid S. Miller <>
parent bbec7802
......@@ -702,14 +702,14 @@ struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
sctp_ulpevent_init(event, 0, skb->len + sizeof(struct sk_buff));
sctp_ulpevent_receive_data(event, asoc);
/* And hold the chunk as we need it for getting the IP headers
* later in recvmsg
event->chunk = chunk;
sctp_ulpevent_receive_data(event, asoc);
event->stream = ntohs(chunk->subh.data_hdr->stream);
event->ssn = ntohs(chunk->subh.data_hdr->ssn);
event->ppid = chunk->subh.data_hdr->ppid;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment