summaryrefslogtreecommitdiffstats
path: root/net/sctp/ulpevent.c
diff options
context:
space:
mode:
authorJonas Falkevik <jonas.falkevik@gmail.com>2020-05-27 11:56:40 +0200
committerDavid S. Miller <davem@davemloft.net>2020-05-28 21:47:02 +0200
commit45ebf73ebcec88a34a778f5feaa0b82b1c76069e (patch)
treeeb6b94a17294dc3d1c0c0946d8bf68e6827baf60 /net/sctp/ulpevent.c
parentbonding: Fix reference count leak in bond_sysfs_slave_add. (diff)
downloadlinux-45ebf73ebcec88a34a778f5feaa0b82b1c76069e.tar.xz
linux-45ebf73ebcec88a34a778f5feaa0b82b1c76069e.zip
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 <jonas.falkevik@gmail.com> Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Reviewed-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/sctp/ulpevent.c3
1 files changed, 3 insertions, 0 deletions
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(&addr, 0, sizeof(struct sockaddr_storage));
memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len);