HomeFreeBSD

pf: improve the ICMPv6 direction check

Description

pf: improve the ICMPv6 direction check

Following bluhm's advice this changes the way we setup state keys and
perform state lookups for ICMPv6 Neighbor Discovery packets:

  • replace the NS-dst with ND target address;
  • replace the NA-src with ND target address;
  • replace the NA-dst with unspecified address if it is a multicast.

This allows pf to match Address Resolution, Neighbor Unreachability
Detection and Duplicate Address Detection packets to the corresponding
states without the need to create new ones or match unrelated ones.
As a side effect we're doing now one state table lookup for ND packets
instead of two.

Fixes a bug uncovered by one of the previous commits that virtually
breaks IPv6 connectivity after few minutes of use.

ok stsp henning, with and ok bluhm

PR: 280701
MFC after: 1 week
Obtained from: OpenBSD, mikeb <mikeb@openbsd.org>, 2633ae8c4c8a
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 5ab1e5f7e5585558a73b723f07528977a82cee82)
(cherry picked from commit b84344206721ed2803d5da68585289d5880efe3f)

Approved-by: re (cperciva)

Details

Provenance
kpAuthored on Aug 26 2024, 12:59 PM
Parents
rG1d75ce83560a: loader.efi.8: Remove rogue duplicated lines
Branches
Unknown
Tags
Unknown