* [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
@ 2015-07-25 5:08 Xin Long
2015-07-27 13:44 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 7+ messages in thread
From: Xin Long @ 2015-07-25 5:08 UTC (permalink / raw)
To: network dev; +Cc: mleitner
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 06320c8..6e399f6 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] 7+ messages in thread
* Re: [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
2015-07-25 5:08 [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
@ 2015-07-27 13:44 ` Marcelo Ricardo Leitner
2015-08-11 4:34 ` lucien xin
0 siblings, 1 reply; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-07-27 13:44 UTC (permalink / raw)
To: Xin Long; +Cc: network dev
On Sat, Jul 25, 2015 at 01:08:08PM +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>
> ---
> 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 06320c8..6e399f6 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
>
Looks good to me.
Marcelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
2015-07-27 13:44 ` Marcelo Ricardo Leitner
@ 2015-08-11 4:34 ` lucien xin
2015-08-11 11:40 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 7+ messages in thread
From: lucien xin @ 2015-08-11 4:34 UTC (permalink / raw)
To: Marcelo Ricardo Leitner, davem; +Cc: network dev
On Mon, Jul 27, 2015 at 9:44 PM, Marcelo Ricardo Leitner
<marcelo.leitner@gmail.com> wrote:
> On Sat, Jul 25, 2015 at 01:08:08PM +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>
>> ---
>> 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 06320c8..6e399f6 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
>>
>
> Looks good to me.
>
> Marcelo
>
any update for this one? is it accepted?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
2015-08-11 4:34 ` lucien xin
@ 2015-08-11 11:40 ` Marcelo Ricardo Leitner
0 siblings, 0 replies; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-08-11 11:40 UTC (permalink / raw)
To: lucien xin, davem; +Cc: network dev
Em 11-08-2015 01:34, lucien xin escreveu:
> On Mon, Jul 27, 2015 at 9:44 PM, Marcelo Ricardo Leitner
> <marcelo.leitner@gmail.com> wrote:
>> On Sat, Jul 25, 2015 at 01:08:08PM +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>
>>> ---
>>> 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 06320c8..6e399f6 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
>>>
>>
>> Looks good to me.
>>
>> Marcelo
>>
>
> any update for this one? is it accepted?
You posted it as RFC only. Now we are waiting for its official version.
Marcelo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
2015-07-24 19:11 ` Marcelo Ricardo Leitner
@ 2015-07-25 5:02 ` lucien xin
0 siblings, 0 replies; 7+ messages in thread
From: lucien xin @ 2015-07-25 5:02 UTC (permalink / raw)
To: Marcelo Ricardo Leitner; +Cc: network dev
On Sat, Jul 25, 2015 at 3:11 AM, Marcelo Ricardo Leitner
<mleitner@redhat.com> wrote:
> On Fri, Jul 24, 2015 at 02:56:29PM +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>
>> ---
>> net/sctp/sm_make_chunk.c | 12 +++++++++++-
>> 1 file changed, 11 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
>> index 06320c8..88d82ef 100644
>> --- a/net/sctp/sm_make_chunk.c
>> +++ b/net/sctp/sm_make_chunk.c
>> @@ -3090,8 +3090,18 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
>
> Please let's avoid increasing the indentation level when possible
>
>> sctp_assoc_set_primary(asoc, asconf->transport);
>> sctp_assoc_del_nonprimary_peers(asoc,
>> asconf->transport);
> add a return here
>
>> - } else
>> + } else {
> and remove this else {}
> and we're good.
>
> sctp code is often too indented, trying to reduce that bit here and
> there.
>
>> + /* 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_del_peer(asoc, &addr);
>
> Here we can replace this call to sctp_assoc_rm_peer() , because if we
> already have peer, we don't have to search for it again.
>
> Thanks,
> Marcelo
>
>> + }
>> break;
>> case SCTP_PARAM_SET_PRIMARY:
>> /* ADDIP Section 4.2.4
>> --
>> 2.1.0
>>
>
>
okay, I will repost it
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
2015-07-24 6:56 Xin Long
@ 2015-07-24 19:11 ` Marcelo Ricardo Leitner
2015-07-25 5:02 ` lucien xin
0 siblings, 1 reply; 7+ messages in thread
From: Marcelo Ricardo Leitner @ 2015-07-24 19:11 UTC (permalink / raw)
To: Xin Long; +Cc: network dev
On Fri, Jul 24, 2015 at 02:56:29PM +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>
> ---
> net/sctp/sm_make_chunk.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index 06320c8..88d82ef 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3090,8 +3090,18 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
Please let's avoid increasing the indentation level when possible
> sctp_assoc_set_primary(asoc, asconf->transport);
> sctp_assoc_del_nonprimary_peers(asoc,
> asconf->transport);
add a return here
> - } else
> + } else {
and remove this else {}
and we're good.
sctp code is often too indented, trying to reduce that bit here and
there.
> + /* 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_del_peer(asoc, &addr);
Here we can replace this call to sctp_assoc_rm_peer() , because if we
already have peer, we don't have to search for it again.
Thanks,
Marcelo
> + }
> break;
> case SCTP_PARAM_SET_PRIMARY:
> /* ADDIP Section 4.2.4
> --
> 2.1.0
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent
@ 2015-07-24 6:56 Xin Long
2015-07-24 19:11 ` Marcelo Ricardo Leitner
0 siblings, 1 reply; 7+ messages in thread
From: Xin Long @ 2015-07-24 6:56 UTC (permalink / raw)
To: network dev; +Cc: mleitner
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 | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 06320c8..88d82ef 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -3090,8 +3090,18 @@ 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
+ } else {
+ /* 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_del_peer(asoc, &addr);
+ }
break;
case SCTP_PARAM_SET_PRIMARY:
/* ADDIP Section 4.2.4
--
2.1.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-11 11:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-25 5:08 [RFC PATCH net] sctp: ASCONF-ACK with Unresolvable Address should be sent Xin Long
2015-07-27 13:44 ` Marcelo Ricardo Leitner
2015-08-11 4:34 ` lucien xin
2015-08-11 11:40 ` Marcelo Ricardo Leitner
-- strict thread matches above, loose matches on Subject: below --
2015-07-24 6:56 Xin Long
2015-07-24 19:11 ` Marcelo Ricardo Leitner
2015-07-25 5:02 ` lucien xin
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).