svn commit: r238492 - head/sys/net
Alexander V. Chernikov
melifaro at FreeBSD.org
Sun Jul 15 17:44:28 UTC 2012
Author: melifaro
Date: Sun Jul 15 17:44:27 2012
New Revision: 238492
URL: http://svn.freebsd.org/changeset/base/238492
Log:
Permit changing MTU in 6to4 relay.
This behavior is recommended by RFC 4213 clause 3.2.
Sometimes fragmentation is the least evil.
For example, some Linux IPVS kernels forwards
ICMPv6 checksums to real servers incorrectly.
Reviewed by: hrs(previous version)
Approved by: kib(mentor)
MFC after: 1 week
Modified:
head/sys/net/if_stf.c
Modified: head/sys/net/if_stf.c
==============================================================================
--- head/sys/net/if_stf.c Sun Jul 15 15:50:12 2012 (r238491)
+++ head/sys/net/if_stf.c Sun Jul 15 17:44:27 2012 (r238492)
@@ -793,7 +793,7 @@ stf_rtrequest(cmd, rt, info)
struct rt_addrinfo *info;
{
RT_LOCK_ASSERT(rt);
- rt->rt_rmx.rmx_mtu = IPV6_MMTU;
+ rt->rt_rmx.rmx_mtu = rt->rt_ifp->if_mtu;
}
static int
@@ -806,7 +806,7 @@ stf_ioctl(ifp, cmd, data)
struct ifreq *ifr;
struct sockaddr_in6 *sin6;
struct in_addr addr;
- int error;
+ int error, mtu;
error = 0;
switch (cmd) {
@@ -840,6 +840,18 @@ stf_ioctl(ifp, cmd, data)
error = EAFNOSUPPORT;
break;
+ case SIOCGIFMTU:
+ break;
+
+ case SIOCSIFMTU:
+ ifr = (struct ifreq *)data;
+ mtu = ifr->ifr_mtu;
+ /* RFC 4213 3.2 ideal world MTU */
+ if (mtu < IPV6_MINMTU || mtu > IF_MAXMTU - 20)
+ return (EINVAL);
+ ifp->if_mtu = mtu;
+ break;
+
default:
error = EINVAL;
break;
More information about the svn-src-head
mailing list