Skip to content

Commit 45ebf73

Browse files
falkevikdavem330
authored andcommitted
sctp: check assoc before SCTP_ADDR_{MADE_PRIM, ADDED} event
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 <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Reviewed-by: Xin Long <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a068aab commit 45ebf73

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/sctp/ulpevent.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ void sctp_ulpevent_nofity_peer_addr_change(struct sctp_transport *transport,
343343
struct sockaddr_storage addr;
344344
struct sctp_ulpevent *event;
345345

346+
if (asoc->state < SCTP_STATE_ESTABLISHED)
347+
return;
348+
346349
memset(&addr, 0, sizeof(struct sockaddr_storage));
347350
memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);
348351

0 commit comments

Comments
 (0)