* Find an entry in the syncache. * Returns always with locked syncache_head plus a matching entry or NULL. */
| 581 | * Returns always with locked syncache_head plus a matching entry or NULL. |
| 582 | */ |
| 583 | static struct syncache * |
| 584 | syncache_lookup(struct in_conninfo *inc, struct syncache_head **schp) |
| 585 | { |
| 586 | struct syncache *sc; |
| 587 | struct syncache_head *sch; |
| 588 | |
| 589 | *schp = sch = syncache_hashbucket(inc); |
| 590 | SCH_LOCK(sch); |
| 591 | |
| 592 | /* Circle through bucket row to find matching entry. */ |
| 593 | TAILQ_FOREACH(sc, &sch->sch_bucket, sc_hash) |
| 594 | if (bcmp(&inc->inc_ie, &sc->sc_inc.inc_ie, |
| 595 | sizeof(struct in_endpoints)) == 0) |
| 596 | break; |
| 597 | |
| 598 | return (sc); /* Always returns with locked sch. */ |
| 599 | } |
| 600 | |
| 601 | /* |
| 602 | * This function is called when we get a RST for a |
no test coverage detected