| 728 | } |
| 729 | |
| 730 | void |
| 731 | syncache_unreach(struct in_conninfo *inc, tcp_seq th_seq) |
| 732 | { |
| 733 | struct syncache *sc; |
| 734 | struct syncache_head *sch; |
| 735 | |
| 736 | if (syncache_cookiesonly()) |
| 737 | return; |
| 738 | sc = syncache_lookup(inc, &sch); /* returns locked sch */ |
| 739 | SCH_LOCK_ASSERT(sch); |
| 740 | if (sc == NULL) |
| 741 | goto done; |
| 742 | |
| 743 | /* If the sequence number != sc_iss, then it's a bogus ICMP msg */ |
| 744 | if (ntohl(th_seq) != sc->sc_iss) |
| 745 | goto done; |
| 746 | |
| 747 | /* |
| 748 | * If we've rertransmitted 3 times and this is our second error, |
| 749 | * we remove the entry. Otherwise, we allow it to continue on. |
| 750 | * This prevents us from incorrectly nuking an entry during a |
| 751 | * spurious network outage. |
| 752 | * |
| 753 | * See tcp_notify(). |
| 754 | */ |
| 755 | if ((sc->sc_flags & SCF_UNREACH) == 0 || sc->sc_rxmits < 3 + 1) { |
| 756 | sc->sc_flags |= SCF_UNREACH; |
| 757 | goto done; |
| 758 | } |
| 759 | syncache_drop(sc, sch); |
| 760 | TCPSTAT_INC(tcps_sc_unreach); |
| 761 | done: |
| 762 | SCH_UNLOCK(sch); |
| 763 | } |
| 764 | |
| 765 | #ifdef LVS_TCPOPT_TOA |
| 766 |
no test coverage detected