]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Handle IPV6_PATHMTU option by spliting ip6_getpmtu_ctl() from ip6_getpmtu().
authormelifaro <melifaro@FreeBSD.org>
Sun, 3 Jan 2016 09:54:03 +0000 (09:54 +0000)
committermelifaro <melifaro@FreeBSD.org>
Sun, 3 Jan 2016 09:54:03 +0000 (09:54 +0000)
commitc0fd3127f0f85f34b72f8afdb6c00d7cd19b13f8
treee884e34dd1ce8bf4a790dc8d8f151b1d5d46bde9
parent3260b587db44b4e61fa6c3babe0282054c38ba62
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
sys/net/route.h
sys/netinet6/in6.h
sys/netinet6/ip6_output.c