| 6880 | } |
| 6881 | |
| 6882 | static struct secspacq * |
| 6883 | key_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 | |
| 6907 | static struct secspacq * |
| 6908 | key_getspacq(struct secpolicyindex *spidx) |
no test coverage detected