]> git.ipfire.org Git - thirdparty/strongswan.git/commit
child-create: Update CHILD_SA IP addresses before installation
authorTobias Brunner <tobias@strongswan.org>
Thu, 15 Oct 2020 11:45:53 +0000 (13:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 27 Oct 2020 15:45:10 +0000 (16:45 +0100)
commitbce0c5fd74a077606fb437a39563352825c33248
treeb28126dfb6cd2fd8cccfde89aa986a780fb81b6d
parent9118fd39d70304e7bd436ac154e34d26ed2faea6
child-create: Update CHILD_SA IP addresses before installation

We create the child_sa_t object when initiating the CREATE_CHILD_SA
request, however, the IP addresses/ports might have changed once we
eventually receive the response (potentially to a retransmit sent to
a different address).  So update them before installing the SA and
policies.

If the local address changed too and depending on the kernel
implementation, the temporary SA created to allocate the inbound SPI
might remain as it can't be updated.  This could cause issues if e.g.
the address switches back before that SA expired (the updated inbound
SA conflicts with the temporary one), or if that happens close together
and the expire (having to wait for the address update) causes the
updated SA to get deleted.

Fixes #3164.
src/libcharon/sa/ikev2/tasks/child_create.c