freebsd-nq/sys/netinet6
Alexander V. Chernikov 1a75e3b20f 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
2014-11-06 13:13:09 +00:00
..
dest6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
frag6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
icmp6.c When deciding whether to call m_pullup() even though there is adequate 2014-10-12 15:49:52 +00:00
icmp6.h
in6_cksum.c Fix the checksum computation for UDPLite/IPv6. This requires the 2014-10-02 10:32:24 +00:00
in6_gif.c Remove redundant check and m_pullup() call. 2014-10-24 13:34:22 +00:00
in6_gif.h Overhaul if_gif(4): 2014-10-14 13:31:47 +00:00
in6_ifattach.c Remove redundant code. 2014-10-30 12:44:46 +00:00
in6_ifattach.h Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group 2013-05-04 19:16:26 +00:00
in6_mcast.c Move ifq drain into in6m_purge(). 2014-10-30 11:34:07 +00:00
in6_pcb.c Make in6_pcblookup_hash_locked and in6_pcbladdr static. 2014-09-10 13:17:35 +00:00
in6_pcb.h Make in6_pcblookup_hash_locked and in6_pcbladdr static. 2014-09-10 13:17:35 +00:00
in6_pcbgroup.c When it's time to do 4-tuple UDP IPv6 hashing, make sure this is a known 2014-07-20 07:39:54 +00:00
in6_proto.c Make checks for rt_mtu generic: 2014-11-06 13:13:09 +00:00
in6_rmx.c Make checks for rt_mtu generic: 2014-11-06 13:13:09 +00:00
in6_src.c Add the ability to set `prefer_source' flag to an IPv6 address. 2014-09-09 10:52:50 +00:00
in6_var.h Make checks for rt_mtu generic: 2014-11-06 13:13:09 +00:00
in6.c Make checks for rt_mtu generic: 2014-11-06 13:13:09 +00:00
in6.h Fix the checksum computation for UDPLite/IPv6. This requires the 2014-10-02 10:32:24 +00:00
ip6_ecn.h
ip6_forward.c Remove redundant call to ipsec_getpolicybyaddr(). 2014-09-30 13:15:19 +00:00
ip6_id.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ip6_input.c Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
ip6_ipsec.c Fixed IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels. 2014-05-28 12:45:27 +00:00
ip6_ipsec.h Fixed IPv4-in-IPv6 and IPv6-in-IPv4 IPsec tunnels. 2014-05-28 12:45:27 +00:00
ip6_mroute.c When deciding whether to call m_pullup() even though there is adequate 2014-10-12 15:49:52 +00:00
ip6_mroute.h revert part of r260485 which changes how part of the header gets 2014-01-09 22:41:18 +00:00
ip6_output.c When deciding whether to call m_pullup() even though there is adequate 2014-10-12 15:49:52 +00:00
ip6_var.h Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
ip6.h
ip6protosw.h Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
mld6_var.h
mld6.c Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
mld6.h
nd6_nbr.c Add rwlock to struct dadq. A panic could occur when a large number of 2014-05-29 20:53:53 +00:00
nd6_rtr.c Use in6_localip() instead of hand-rolled cycle. 2014-01-18 20:54:55 +00:00
nd6.c Make checks for rt_mtu generic: 2014-11-06 13:13:09 +00:00
nd6.h Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
pim6_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
pim6.h
raw_ip6.c Merge 'struct ip6protosw' and 'struct protosw' into one. Now we have 2014-08-08 01:57:15 +00:00
raw_ip6.h Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters. 2013-07-09 09:54:54 +00:00
route6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
scope6_var.h Introduce new scope related functions. 2014-09-11 12:33:37 +00:00
scope6.c * use M_ZERO flag with malloc instead of explicit zeroing. 2014-09-11 12:54:17 +00:00
sctp6_usrreq.c Use union sctp_sockstore instead of struct sockaddr_storage. This 2014-09-07 09:06:26 +00:00
sctp6_var.h Add support for SCTP/UDP/IPV6. 2012-11-17 20:04:04 +00:00
send.c Free mbuf in case of error. 2013-12-17 10:53:17 +00:00
send.h
tcp6_var.h Remove __P. 2012-10-22 21:49:56 +00:00
udp6_usrreq.c Add context pointer and source address to the UDP tunnel callback 2014-10-10 06:08:59 +00:00
udp6_var.h Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00