TCP Wrappers
While originally written to protect TCP and UDP accepting services , examples of usage to filter on certain ICMP packets exist too , such as 'pingd' – the userspace ping request responder . 
<triplet> ping <subj> ICMP <obj> uses