cleanup_expirations(&tdbp->tdb_dst, tdbp->tdb_spi, tdbp->tdb_sproto);
if ((tdbp->tdb_flags & TDBF_INVALID) == 0) cleanup_expirations(&tdbp->tdb_dst, tdbp->tdb_spi, tdbp->tdb_sproto);
tdb_delete(struct tdb *tdbp, int delchain){    u_int8_t *ptr = (u_int8_t *) &tdbp->tdb_dst;    struct tdb *tdbpp;    u_int32_t hashval = tdbp->tdb_sproto + tdbp->tdb_spi, i;    for (i = 0; i < SA_LEN(&tdbp->tdb_dst.sa); i++)      hashval += ptr[i];    hashval %= TDB_HASHMOD;    if (tdbh[hashval] == tdbp)    {	tdbpp = tdbp;	tdbh[hashval] = tdbp->tdb_hnext;    }    else      for (tdbpp = tdbh[hashval]; tdbpp != NULL; tdbpp = tdbpp->tdb_hnext)	if (tdbpp->tdb_hnext == tdbp)	{	    tdbpp->tdb_hnext = tdbp->tdb_hnext;	    tdbpp = tdbp;	}    /*     * If there was something before us in the chain pointing to us,     * make it point nowhere     */    if ((tdbp->tdb_inext) &&	(tdbp->tdb_inext->tdb_onext == tdbp))      tdbp->tdb_inext->tdb_onext = NULL;    /*      * If there was something after us in the chain pointing to us,     * make it point nowhere     */    if ((tdbp->tdb_onext) &&	(tdbp->tdb_onext->tdb_inext == tdbp))      tdbp->tdb_onext->tdb_inext = NULL;        tdbpp = tdbp->tdb_onext;        if (tdbp->tdb_xform)      (*(tdbp->tdb_xform->xf_zeroize))(tdbp);    while (tdbp->tdb_flow)    {	delete_flow(tdbp->tdb_flow, tdbp);	ipsec_in_use--;    }    cleanup_expirations(&tdbp->tdb_dst, tdbp->tdb_spi, tdbp->tdb_sproto);    if (tdbp->tdb_srcid)      FREE(tdbp->tdb_srcid, M_XDATA);    if (tdbp->tdb_dstid)      FREE(tdbp->tdb_dstid, M_XDATA);    FREE(tdbp, M_TDB);    if (delchain && tdbpp)      return tdb_delete(tdbpp, delchain);    else      return 0;}