Re: [PATCH net] sctp: use event->chunk when it's valid

2016-08-08 Thread David Miller
From: Xin Long 
Date: Sun,  7 Aug 2016 14:15:13 +0800

> Commit 52253db924d1 ("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: 52253db924d1 ("sctp: also point GSO head_skb to the sk when it's 
> available")
> Signed-off-by: Xin Long 

Applied, thank you.


Re: [PATCH net] sctp: use event->chunk when it's valid

2016-08-08 Thread Neil Horman
On Sun, Aug 07, 2016 at 02:15:13PM +0800, Xin Long wrote:
> Commit 52253db924d1 ("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: 52253db924d1 ("sctp: also point GSO head_skb to the sk when it's 
> available")
> Signed-off-by: Xin Long 
> ---
>  net/sctp/ulpevent.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
> index 1bc4f71..d85b803 100644
> --- a/net/sctp/ulpevent.c
> +++ b/net/sctp/ulpevent.c
> @@ -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
>*/
>   sctp_chunk_hold(chunk);
>   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;
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Acked-by: Neil Horman 


Re: [PATCH net] sctp: use event->chunk when it's valid

2016-08-08 Thread Marcelo Ricardo Leitner
On Sun, Aug 07, 2016 at 02:15:13PM +0800, Xin Long wrote:
> Commit 52253db924d1 ("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: 52253db924d1 ("sctp: also point GSO head_skb to the sk when it's 
> available")
> Signed-off-by: Xin Long 

Acked-by: Marcelo Ricardo Leitner 

> ---
>  net/sctp/ulpevent.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
> index 1bc4f71..d85b803 100644
> --- a/net/sctp/ulpevent.c
> +++ b/net/sctp/ulpevent.c
> @@ -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
>*/
>   sctp_chunk_hold(chunk);
>   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;
> -- 
> 2.1.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


[PATCH net] sctp: use event->chunk when it's valid

2016-08-07 Thread Xin Long
Commit 52253db924d1 ("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: 52253db924d1 ("sctp: also point GSO head_skb to the sk when it's 
available")
Signed-off-by: Xin Long 
---
 net/sctp/ulpevent.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index 1bc4f71..d85b803 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -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
 */
sctp_chunk_hold(chunk);
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;
-- 
2.1.0