| 898 | } |
| 899 | |
| 900 | static int |
| 901 | ipsec_check_reqid(uint32_t reqid) |
| 902 | { |
| 903 | struct ipsec_softc *sc; |
| 904 | |
| 905 | sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); |
| 906 | CK_LIST_FOREACH(sc, ipsec_idhash(reqid), idhash) { |
| 907 | if (sc->reqid == reqid) |
| 908 | return (EEXIST); |
| 909 | } |
| 910 | return (0); |
| 911 | } |
| 912 | |
| 913 | /* |
| 914 | * We use key_newreqid() to automatically obtain unique reqid. |
no test coverage detected