Skip to contentSkip to conversation

sctp: ASCONF-ACK with Unresolvable Address should be sent

RFC PATCH In review Xin Long 2 participants 3 messages Jul 24, 2015 – Jul 25, 2015

Subsystems (3)
lore
Share & tools
lore

Xin Long

author maintainer
#0 lore raw

RFC PATCH 1/1 sctp: ASCONF-ACK with Unresolvable Address should be sent

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)
---
 net/sctp/sm_make_chunk.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
net/sctp/sm_make_chunk.c +11 -1
index 06320c8..88d82ef 100644
@@ -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
Signature · 1 line
2.1.0
#1 lore raw

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc,

Quoted 34 lines · Xin Long

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)
---
 net/sctp/sm_make_chunk.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
net/sctp/sm_make_chunk.c +0 -0
index 06320c8..88d82ef 100644
@@ -3090,8 +3090,18 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,

Please let's avoid increasing the indentation level when possible

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3092

Quoted 3 lines
net/sctp/sm_make_chunk.c +0 -0
 			sctp_assoc_set_primary(asoc, asconf->transport);
 			sctp_assoc_del_nonprimary_peers(asoc,
 							asconf->transport);

add a return here

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3093

Quoted 2 lines
net/sctp/sm_make_chunk.c +1 -1
-		} else
+		} else {

and remove this else {}
and we're good.

sctp code is often too indented, trying to reduce that bit here and there.

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3103

Quoted 10 lines
net/sctp/sm_make_chunk.c +9 -0
+			/* 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

Quoted 7 lines
net/sctp/sm_make_chunk.c +1 -0
+		}
 		break;
 	case SCTP_PARAM_SET_PRIMARY:
 		/* ADDIP Section 4.2.4
Signature · 1 line
2.1.0
author maintainer
#2 lore raw
Quoted 62 lines · Marcelo Ricardo Leitner

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc,

Quoted 34 lines · Xin Long

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)
---
 net/sctp/sm_make_chunk.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
net/sctp/sm_make_chunk.c +0 -0
index 06320c8..88d82ef 100644
@@ -3090,8 +3090,18 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,

Please let's avoid increasing the indentation level when possible

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3092

Quoted 3 lines
net/sctp/sm_make_chunk.c +0 -0
                      sctp_assoc_set_primary(asoc, asconf->transport);
                      sctp_assoc_del_nonprimary_peers(asoc,
                                                      asconf->transport);

add a return here

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3093

Quoted 2 lines
net/sctp/sm_make_chunk.c +1 -1
-             } else
+             } else {

and remove this else {}
and we're good.

sctp code is often too indented, trying to reduce that bit here and there.

net/sctp/sm_make_chunk.c static __be16 sctp_process_asconf_param(struct sctp_association *asoc, · line 3103

Quoted 10 lines
net/sctp/sm_make_chunk.c +9 -0
+                     /* 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);
Quoted 15 lines

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

Quoted 7 lines
net/sctp/sm_make_chunk.c +1 -1
+             }
              break;
      case SCTP_PARAM_SET_PRIMARY:
              /* ADDIP Section 4.2.4
--

2.1.0

okay, I will repost it