aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_var.h
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2014-11-06 13:13:09 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2014-11-06 13:13:09 +0000
commit1a75e3b20f213109288e0d2f675ad8fe0e2e7c63 (patch)
treee082f90704be30b48e7fe45d4a0f281b5f2aeb38 /sys/net/if_var.h
parent295e858606876e268796c84a6b19ce1484ac9fda (diff)
downloadsrc-1a75e3b20f213109288e0d2f675ad8fe0e2e7c63.tar.gz
src-1a75e3b20f213109288e0d2f675ad8fe0e2e7c63.zip
Make checks for rt_mtu generic:
Some virtual if drivers has (ab)used ifa ifa_rtrequest hook to enforce route MTU to be not bigger that interface MTU. While ifa_rtrequest hooking might be an option in some situation, it is not feasible to do MTU checks there: generic (or per-domain) routing code is perfectly capable of doing this. We currrently have 3 places where MTU is altered: 1) route addition. In this case domain overrides radix _addroute callback (in[6]_addroute) and all necessary checks/fixes are/can be done there. 2) route change (especially, GW change). In this case, there are no explicit per-domain calls, but one can override rte by setting ifa_rtrequest hook to domain handler (inet6 does this). 3) ifconfig ifaceX mtu YYYY In this case, we have no callbacks, but ip[6]_output performes runtime checks and decreases rt_mtu if necessary. Generally, the goals are to be able to handle all MTU changes in control plane, not in runtime part, and properly deal with increased interface MTU. This commit changes the following: * removes hooks setting MTU from drivers side * adds proper per-doman MTU checks for case 1) * adds generic MTU check for case 2) * The latter is done by using new dom_ifmtu callback since if_mtu denotes L3 interface MTU, e.g. maximum trasmitted _packet_ size. However, IPv6 mtu might be different from if_mtu one (e.g. default 1280) for some cases, so we need an abstract way to know maximum MTU size for given interface and domain. * moves rt_setmetrics() before MTU/ifa_rtrequest hooks since it copies user-supplied data which must be checked. * removes RT_LOCK_ASSERT() from other ifa_rtrequest hooks to be able to use this functions on new non-inserted rte. More changes will follow soon. MFC after: 1 month Sponsored by: Yandex LLC
Notes
Notes: svn path=/head/; revision=274175
Diffstat (limited to 'sys/net/if_var.h')
-rw-r--r--sys/net/if_var.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 4552b6c9b72c..049d3b043e0a 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -556,6 +556,7 @@ void *if_getsoftc(if_t ifp);
int if_setflags(if_t ifp, int flags);
int if_setmtu(if_t ifp, int mtu);
int if_getmtu(if_t ifp);
+int if_getmtu_family(if_t ifp, int family);
int if_setflagbits(if_t ifp, int set, int clear);
int if_getflags(if_t ifp);
int if_sendq_empty(if_t ifp);