netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent
@ 2015-08-28  9:45 Xin Long
  2015-08-28 12:43 ` Vlad Yasevich
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Xin Long @ 2015-08-28  9:45 UTC (permalink / raw)
  To: network dev; +Cc: mleitner, davem, vyasevic

RFC 5061:
    This is an opaque integer assigned by the sender to identify each
    request parameter.  The receiver of the ASCONF Chunk will copy this
    32-bit value into the ASCONF Response Correlation ID field of the
    ASCONF-ACK response parameter.  The sender of the ASCONF can use this
    same value in the ASCONF-ACK to find which request the response is
    for.  Note that the receiver MUST NOT change this 32-bit value.

    Address Parameter: TLV

    This field contains an IPv4 or IPv6 address parameter, as described
    in Section 3.3.2.1 of [RFC4960].

ASCONF chunk with Error Cause Indication Parameter (Unresolvable Address)
should be sent if the Delete IP Address is not part of the association.

  Endpoint A                           Endpoint B
  (ESTABLISHED)                        (ESTABLISHED)

  ASCONF        ----------------->
  (Delete IP Address)
                <-----------------      ASCONF-ACK
                                        (Unresolvable Address)

Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
 net/sctp/sm_make_chunk.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 4068fe1..ce7f343 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3090,8 +3090,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 			sctp_assoc_set_primary(asoc, asconf->transport);
 			sctp_assoc_del_nonprimary_peers(asoc,
 							asconf->transport);
-		} else
-			sctp_assoc_del_peer(asoc, &addr);
+			return SCTP_ERROR_NO_ERROR;
+		}
+
+		/* If the address is not part of the association, the
+		 * ASCONF-ACK with Error Cause Indication Parameter
+		 * which including cause of Unresolvable Address should
+		 * be sent.
+		 */
+		peer = sctp_assoc_lookup_paddr(asoc, &addr);
+		if (!peer)
+			return SCTP_ERROR_DNS_FAILED;
+
+		sctp_assoc_rm_peer(asoc, peer);
 		break;
 	case SCTP_PARAM_SET_PRIMARY:
 		/* ADDIP Section 4.2.4
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent
  2015-08-28  9:45 [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
@ 2015-08-28 12:43 ` Vlad Yasevich
  2015-08-28 13:50 ` Marcelo Ricardo Leitner
  2015-08-29  5:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Vlad Yasevich @ 2015-08-28 12:43 UTC (permalink / raw)
  To: Xin Long, network dev; +Cc: mleitner, davem, vyasevic

On 08/28/2015 05:45 AM, Xin Long wrote:
> RFC 5061:
>     This is an opaque integer assigned by the sender to identify each
>     request parameter.  The receiver of the ASCONF Chunk will copy this
>     32-bit value into the ASCONF Response Correlation ID field of the
>     ASCONF-ACK response parameter.  The sender of the ASCONF can use this
>     same value in the ASCONF-ACK to find which request the response is
>     for.  Note that the receiver MUST NOT change this 32-bit value.
> 
>     Address Parameter: TLV
> 
>     This field contains an IPv4 or IPv6 address parameter, as described
>     in Section 3.3.2.1 of [RFC4960].
> 
> ASCONF chunk with Error Cause Indication Parameter (Unresolvable Address)
> should be sent if the Delete IP Address is not part of the association.
> 
>   Endpoint A                           Endpoint B
>   (ESTABLISHED)                        (ESTABLISHED)
> 
>   ASCONF        ----------------->
>   (Delete IP Address)
>                 <-----------------      ASCONF-ACK
>                                         (Unresolvable Address)
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Vlad Yasevich <vyasevich@gmail.com>

-vlad

> ---
>  net/sctp/sm_make_chunk.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 4068fe1..ce7f343 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3090,8 +3090,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
>  			sctp_assoc_set_primary(asoc, asconf->transport);
>  			sctp_assoc_del_nonprimary_peers(asoc,
>  							asconf->transport);
> -		} else
> -			sctp_assoc_del_peer(asoc, &addr);
> +			return SCTP_ERROR_NO_ERROR;
> +		}
> +
> +		/* If the address is not part of the association, the
> +		 * ASCONF-ACK with Error Cause Indication Parameter
> +		 * which including cause of Unresolvable Address should
> +		 * be sent.
> +		 */
> +		peer = sctp_assoc_lookup_paddr(asoc, &addr);
> +		if (!peer)
> +			return SCTP_ERROR_DNS_FAILED;
> +
> +		sctp_assoc_rm_peer(asoc, peer);
>  		break;
>  	case SCTP_PARAM_SET_PRIMARY:
>  		/* ADDIP Section 4.2.4
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent
  2015-08-28  9:45 [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
  2015-08-28 12:43 ` Vlad Yasevich
@ 2015-08-28 13:50 ` Marcelo Ricardo Leitner
  2015-08-29  5:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-28 13:50 UTC (permalink / raw)
  To: Xin Long; +Cc: network dev, davem, vyasevic

On Fri, Aug 28, 2015 at 05:45:58PM +0800, Xin Long wrote:
> RFC 5061:
>     This is an opaque integer assigned by the sender to identify each
>     request parameter.  The receiver of the ASCONF Chunk will copy this
>     32-bit value into the ASCONF Response Correlation ID field of the
>     ASCONF-ACK response parameter.  The sender of the ASCONF can use this
>     same value in the ASCONF-ACK to find which request the response is
>     for.  Note that the receiver MUST NOT change this 32-bit value.
> 
>     Address Parameter: TLV
> 
>     This field contains an IPv4 or IPv6 address parameter, as described
>     in Section 3.3.2.1 of [RFC4960].
> 
> ASCONF chunk with Error Cause Indication Parameter (Unresolvable Address)
> should be sent if the Delete IP Address is not part of the association.
> 
>   Endpoint A                           Endpoint B
>   (ESTABLISHED)                        (ESTABLISHED)
> 
>   ASCONF        ----------------->
>   (Delete IP Address)
>                 <-----------------      ASCONF-ACK
>                                         (Unresolvable Address)
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>

> ---
>  net/sctp/sm_make_chunk.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 4068fe1..ce7f343 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3090,8 +3090,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
>  			sctp_assoc_set_primary(asoc, asconf->transport);
>  			sctp_assoc_del_nonprimary_peers(asoc,
>  							asconf->transport);
> -		} else
> -			sctp_assoc_del_peer(asoc, &addr);
> +			return SCTP_ERROR_NO_ERROR;
> +		}
> +
> +		/* If the address is not part of the association, the
> +		 * ASCONF-ACK with Error Cause Indication Parameter
> +		 * which including cause of Unresolvable Address should
> +		 * be sent.
> +		 */
> +		peer = sctp_assoc_lookup_paddr(asoc, &addr);
> +		if (!peer)
> +			return SCTP_ERROR_DNS_FAILED;
> +
> +		sctp_assoc_rm_peer(asoc, peer);
>  		break;
>  	case SCTP_PARAM_SET_PRIMARY:
>  		/* ADDIP Section 4.2.4
> -- 
> 2.1.0
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent
  2015-08-28  9:45 [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
  2015-08-28 12:43 ` Vlad Yasevich
  2015-08-28 13:50 ` Marcelo Ricardo Leitner
@ 2015-08-29  5:26 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-08-29  5:26 UTC (permalink / raw)
  To: lucien.xin; +Cc: netdev, mleitner, vyasevic

From: Xin Long <lucien.xin@gmail.com>
Date: Fri, 28 Aug 2015 17:45:58 +0800

> RFC 5061:
>     This is an opaque integer assigned by the sender to identify each
>     request parameter.  The receiver of the ASCONF Chunk will copy this
>     32-bit value into the ASCONF Response Correlation ID field of the
>     ASCONF-ACK response parameter.  The sender of the ASCONF can use this
>     same value in the ASCONF-ACK to find which request the response is
>     for.  Note that the receiver MUST NOT change this 32-bit value.
> 
>     Address Parameter: TLV
> 
>     This field contains an IPv4 or IPv6 address parameter, as described
>     in Section 3.3.2.1 of [RFC4960].
> 
> ASCONF chunk with Error Cause Indication Parameter (Unresolvable Address)
> should be sent if the Delete IP Address is not part of the association.
> 
>   Endpoint A                           Endpoint B
>   (ESTABLISHED)                        (ESTABLISHED)
> 
>   ASCONF        ----------------->
>   (Delete IP Address)
>                 <-----------------      ASCONF-ACK
>                                         (Unresolvable Address)
> 
> Signed-off-by: Xin Long <lucien.xin@gmail.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-29  5:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28  9:45 [PATCH net v2] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
2015-08-28 12:43 ` Vlad Yasevich
2015-08-28 13:50 ` Marcelo Ricardo Leitner
2015-08-29  5:26 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).