summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2016-01-03 09:54:03 +0000
committermelifaro <melifaro@FreeBSD.org>2016-01-03 09:54:03 +0000
commitc0fd3127f0f85f34b72f8afdb6c00d7cd19b13f8 (patch)
treee884e34dd1ce8bf4a790dc8d8f151b1d5d46bde9 /sys/net/route.h
parent3260b587db44b4e61fa6c3babe0282054c38ba62 (diff)
downloadFreeBSD-src-c0fd3127f0f85f34b72f8afdb6c00d7cd19b13f8.zip
FreeBSD-src-c0fd3127f0f85f34b72f8afdb6c00d7cd19b13f8.tar.gz
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
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 743c830..847722c 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -44,16 +44,17 @@
*/
/*
- * A route consists of a destination address, a reference
- * to a routing entry, and a reference to an llentry.
- * These are often held by protocols in their control
- * blocks, e.g. inpcb.
+ * Struct route consiste of a destination address,
+ * a route entry pointer, link-layer prepend data pointer along
+ * with its length.
*/
struct route {
struct rtentry *ro_rt;
char *ro_prepend;
uint16_t ro_plen;
uint16_t ro_flags;
+ uint16_t ro_mtu; /* saved ro_rt mtu */
+ uint16_t spare;
struct sockaddr ro_dst;
};
OpenPOWER on IntegriCloud