Re: [PATCH v2] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event

2020-05-28 Thread David Miller
From: Jonas Falkevik 
Date: Wed, 27 May 2020 11:56:40 +0200

> Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations
> that have been established.
> 
> These events are described in rfc6458#section-6.1
> SCTP_PEER_ADDR_CHANGE:
> This tag indicates that an address that is
> part of an existing association has experienced a change of
> state (e.g., a failure or return to service of the reachability
> of an endpoint via a specific transport address).
> 
> Signed-off-by: Jonas Falkevik 
> ---
> Changes in v2:
>  - Check asoc state to be at least established.
>Instead of associd being SCTP_FUTURE_ASSOC.
>  - Common check for all peer addr change event

Applied and queued up for -stable, thanks.

 



Re: [PATCH v2] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event

2020-05-27 Thread Xin Long
On Wed, May 27, 2020 at 5:57 PM Jonas Falkevik  wrote:
>
> Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations
> that have been established.
>
> These events are described in rfc6458#section-6.1
> SCTP_PEER_ADDR_CHANGE:
> This tag indicates that an address that is
> part of an existing association has experienced a change of
> state (e.g., a failure or return to service of the reachability
> of an endpoint via a specific transport address).
>
> Signed-off-by: Jonas Falkevik 
Reviewed-by: Xin Long 

> ---
> Changes in v2:
>  - Check asoc state to be at least established.
>Instead of associd being SCTP_FUTURE_ASSOC.
>  - Common check for all peer addr change event
>
>  net/sctp/ulpevent.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
> index c82dbdcf13f2..77d5c36a8991 100644
> --- a/net/sctp/ulpevent.c
> +++ b/net/sctp/ulpevent.c
> @@ -343,6 +343,9 @@ void sctp_ulpevent_nofity_peer_addr_change(struct 
> sctp_transport *transport,
> struct sockaddr_storage addr;
> struct sctp_ulpevent *event;
>
> +   if (asoc->state < SCTP_STATE_ESTABLISHED)
> +   return;
> +
> memset(, 0, sizeof(struct sockaddr_storage));
> memcpy(, >ipaddr, 
> transport->af_specific->sockaddr_len);
>
> --
> 2.25.4
>


Re: [PATCH v2] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event

2020-05-27 Thread Marcelo Ricardo Leitner
On Wed, May 27, 2020 at 11:56:40AM +0200, Jonas Falkevik wrote:
> Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations
> that have been established.
> 
> These events are described in rfc6458#section-6.1
> SCTP_PEER_ADDR_CHANGE:
> This tag indicates that an address that is
> part of an existing association has experienced a change of
> state (e.g., a failure or return to service of the reachability
> of an endpoint via a specific transport address).
> 
> Signed-off-by: Jonas Falkevik 

Acked-by: Marcelo Ricardo Leitner 
Thanks!

> ---
> Changes in v2:
>  - Check asoc state to be at least established.
>Instead of associd being SCTP_FUTURE_ASSOC.
>  - Common check for all peer addr change event
> 
>  net/sctp/ulpevent.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
> index c82dbdcf13f2..77d5c36a8991 100644
> --- a/net/sctp/ulpevent.c
> +++ b/net/sctp/ulpevent.c
> @@ -343,6 +343,9 @@ void sctp_ulpevent_nofity_peer_addr_change(struct 
> sctp_transport *transport,
>   struct sockaddr_storage addr;
>   struct sctp_ulpevent *event;
>  
> + if (asoc->state < SCTP_STATE_ESTABLISHED)
> + return;
> +
>   memset(, 0, sizeof(struct sockaddr_storage));
>   memcpy(, >ipaddr, transport->af_specific->sockaddr_len);
>  
> -- 
> 2.25.4
> 


[PATCH v2] sctp: check assoc before SCTP_ADDR_{MADE_PRIM,ADDED} event

2020-05-27 Thread Jonas Falkevik
Make sure SCTP_ADDR_{MADE_PRIM,ADDED} are sent only for associations
that have been established.

These events are described in rfc6458#section-6.1
SCTP_PEER_ADDR_CHANGE:
This tag indicates that an address that is
part of an existing association has experienced a change of
state (e.g., a failure or return to service of the reachability
of an endpoint via a specific transport address).

Signed-off-by: Jonas Falkevik 
---
Changes in v2:
 - Check asoc state to be at least established.
   Instead of associd being SCTP_FUTURE_ASSOC.
 - Common check for all peer addr change event

 net/sctp/ulpevent.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index c82dbdcf13f2..77d5c36a8991 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -343,6 +343,9 @@ void sctp_ulpevent_nofity_peer_addr_change(struct 
sctp_transport *transport,
struct sockaddr_storage addr;
struct sctp_ulpevent *event;
 
+   if (asoc->state < SCTP_STATE_ESTABLISHED)
+   return;
+
memset(, 0, sizeof(struct sockaddr_storage));
memcpy(, >ipaddr, transport->af_specific->sockaddr_len);
 
-- 
2.25.4