When a pfil hook rewrites the destination of a packet to one of the
router's own addresses (pf rdr), ip6_tryforward() looks up the route to
the new destination and transmits the packet on the loopback interface
that route names. The sender gets no answer, and for a packet that
arrived with a hop limit of 1 it gets a time exceeded error.
ip_tryforward() checks for a local destination after the hooks, and
ip6_input() runs the inbound hooks before it decides whether a packet
is for this host, so neither has the problem. So far it only shows
when net.inet6.ip6.redirect is 0.
After the inbound and the outbound hooks, when the destination changed
and is now a local address, mark the packet M_FASTFWD_OURS and return
it to ip6_input() for delivery, as ip_tryforward() does. The new
forward:v6_rdr_local test covers the inbound case on both forwarding
paths.
Fixes: 5a1842a2 ("Add ip6_tryforward() - a run to completion ...")
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")