* 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 */
| 2787 | * code - not used at this moment |
| 2788 | */ |
| 2789 | static int |
| 2790 | icmp6_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 | } |
no test coverage detected