* External function: look up an entry in the hostcache and return the * discovered path MTU. Returns 0 if no entry is found or value is not * set. */
| 480 | * set. |
| 481 | */ |
| 482 | uint32_t |
| 483 | tcp_hc_getmtu(struct in_conninfo *inc) |
| 484 | { |
| 485 | struct hc_metrics *hc_entry; |
| 486 | uint32_t mtu; |
| 487 | |
| 488 | if (!V_tcp_use_hostcache) |
| 489 | return 0; |
| 490 | |
| 491 | hc_entry = tcp_hc_lookup(inc); |
| 492 | if (hc_entry == NULL) { |
| 493 | return 0; |
| 494 | } |
| 495 | hc_entry->rmx_hits++; |
| 496 | hc_entry->rmx_expire = V_tcp_hostcache.expire; /* start over again */ |
| 497 | |
| 498 | mtu = hc_entry->rmx_mtu; |
| 499 | THC_UNLOCK(&hc_entry->rmx_head->hch_mtx); |
| 500 | return mtu; |
| 501 | } |
| 502 | |
| 503 | /* |
| 504 | * External function: update the MTU value of an entry in the hostcache. |
no test coverage detected