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

Function icmp6_ratelimit

freebsd/netinet6/icmp6.c:2789–2805  ·  view source on GitHub ↗

* Perform rate limit check. * Returns 0 if it is okay to send the icmp6 packet. * Returns 1 if the router SHOULD NOT send this icmp6 packet due to rate * limitation. * * XXX per-destination/type check necessary? * * dst - not used at this moment * type - not used at this moment * code - not used at this moment */

Source from the content-addressed store, hash-verified

2787 * code - not used at this moment
2788 */
2789static int
2790icmp6_ratelimit(const struct in6_addr *dst, const int type,
2791 const int code)
2792{
2793 int ret;
2794
2795 ret = 0; /* okay to send */
2796
2797 /* PPS limit */
2798 if (!ppsratecheck(&V_icmp6errppslim_last, &V_icmp6errpps_count,
2799 V_icmp6errppslim)) {
2800 /* The packet is subject to rate limit */
2801 ret++;
2802 }
2803
2804 return ret;
2805}

Callers 2

icmp6_errorFunction · 0.85
icmp6_redirect_outputFunction · 0.85

Calls 1

ppsratecheckFunction · 0.50

Tested by

no test coverage detected