diff options
Diffstat (limited to 'usr/src/uts')
-rw-r--r-- | usr/src/uts/common/inet/ip/sadb.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/uts/common/inet/ip/sadb.c b/usr/src/uts/common/inet/ip/sadb.c index 14848656ed..52d2348fcf 100644 --- a/usr/src/uts/common/inet/ip/sadb.c +++ b/usr/src/uts/common/inet/ip/sadb.c @@ -23,6 +23,7 @@ * Use is subject to license terms. * Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2018 Joyent, Inc. + * Copyright 2022 MNX Cloud, Inc. */ #include <sys/types.h> @@ -327,13 +328,16 @@ sadb_unlinkassoc(ipsa_t *ipsa) ASSERT(ipsa->ipsa_linklock != NULL); ASSERT(MUTEX_HELD(ipsa->ipsa_linklock)); + /* Sometimes someone beats us here with the same SA. Check now. */ + if (ipsa->ipsa_ptpn == NULL) + return; + /* These fields are protected by the link lock. */ *(ipsa->ipsa_ptpn) = ipsa->ipsa_next; if (ipsa->ipsa_next != NULL) { ipsa->ipsa_next->ipsa_ptpn = ipsa->ipsa_ptpn; ipsa->ipsa_next = NULL; } - ipsa->ipsa_ptpn = NULL; /* This may destroy the SA. */ |