Skip to main content

attach_icmp_filter

Function attach_icmp_filter 

Source
pub(crate) fn attach_icmp_filter(
    socket: &Socket,
    icmp_id: u16,
    is_ipv6: bool,
) -> Result<()>
Expand description

Attach a filter to a raw ICMP socket so the kernel only delivers ICMP echo replies whose identifier matches icmp_id, dropping all other ICMP traffic.

ยงArguments

  • socket - the raw ICMP socket to attach the filter to
  • icmp_id - the ICMP identifier used for this measurement
  • is_ipv6 - whether this is an IPv6 (ICMPv6) socket