HomeFreeBSD

Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu().

Description

Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu().
Add ro_mtu field to 'struct route' to be able to pass lookup MTU back to

the caller.

Currently, ip6_getpmtu() has 2 totally different use cases:

  1. control plane (IPV6_PATHMTU req), where we just need to calculate MTU and return it, w/o any reusability.
  2. Actual ip6_output() data path where we (nearly) always use the provided route lookup data. If this data is not 'valid' we need to perform another lookup and save the result (which cannot be re-used by ip6_output()).

Given that, handle 1) by calling separate function doing rte lookup itself.

Resulting MTU is calculated by (newly-added) ip6_calcmtu() used by both
ip6_getpmtu_ctl() and ip6_getpmtu().

For 2) instead of storing ref'ed rte, store mtu (the only needed data

from the lookup result) inside newly-added ro_mtu field.
'struct route' was shrinked by 8(or 4 bytes) in r292978. Grow it again
by 4 bytes. New ro_mtu field will be used in other places like
ip/tcp_output (EMSGSIZE handling from output routines).

Reviewed by: ae

Details

Provenance
melifaroAuthored on
Reviewer
ae
Parents
rS293097: MFC r279465,r284558,r285189,r285273:
Branches
Unknown
Tags
Unknown