Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jonas Falkevik and committed by
David S. Miller
45ebf73e a068aab4

+3
+3
net/sctp/ulpevent.c
··· 343 343 struct sockaddr_storage addr; 344 344 struct sctp_ulpevent *event; 345 345 346 + if (asoc->state < SCTP_STATE_ESTABLISHED) 347 + return; 348 + 346 349 memset(&addr, 0, sizeof(struct sockaddr_storage)); 347 350 memcpy(&addr, &transport->ipaddr, transport->af_specific->sockaddr_len); 348 351