MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcp_hc_getmtu

Function tcp_hc_getmtu

freebsd/netinet/tcp_hostcache.c:482–501  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

480 * set.
481 */
482uint32_t
483tcp_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.

Callers 3

sctp_hc_get_mtuFunction · 0.85
tcp_mssoptFunction · 0.85
ip6_calcmtuFunction · 0.85

Calls 1

tcp_hc_lookupFunction · 0.85

Tested by

no test coverage detected