MCPcopy Create free account
hub / github.com/F-Stack/f-stack / key_newspacq

Function key_newspacq

freebsd/netipsec/key.c:6882–6905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6880}
6881
6882static struct secspacq *
6883key_newspacq(struct secpolicyindex *spidx)
6884{
6885 struct secspacq *acq;
6886
6887 /* get new entry */
6888 acq = malloc(sizeof(struct secspacq), M_IPSEC_SAQ, M_NOWAIT|M_ZERO);
6889 if (acq == NULL) {
6890 ipseclog((LOG_DEBUG, "%s: No more memory.\n", __func__));
6891 return NULL;
6892 }
6893
6894 /* copy secindex */
6895 bcopy(spidx, &acq->spidx, sizeof(acq->spidx));
6896 acq->created = time_second;
6897 acq->count = 0;
6898
6899 /* add to spacqtree */
6900 SPACQ_LOCK();
6901 LIST_INSERT_HEAD(&V_spacqtree, acq, chain);
6902 SPACQ_UNLOCK();
6903
6904 return acq;
6905}
6906
6907static struct secspacq *
6908key_getspacq(struct secpolicyindex *spidx)

Callers 1

key_spdacquireFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected