The Advanced Sockets Application Program Interface (API) for IPv6 allows user code to request features from the kernel.
Whilst testing Homenet hnetd I recently came across an MTU issue.
I could solve this by manually setting the MTU per interface for all packets. It would be better IMHO if the daemon could set the socket option.
However when I tried this I found the following in <linux/in6.h> in the current openwrt build tree.
.. #if 0 /* not yet */ #define IPV6_USE_MIN_MTU 63 #endif
Would anyone be willing to port/ back port this to the Openwrt kernel?
I've managed to work around this myself, as apparently this is more a problem of the upstream kernel than OpenWRT.
Anyway a similar solution to this worked for me in case anyone else finds this in the future:
# if defined(IPV6_USE_MIN_MTU)
[...]
# elif defined(IPV6_MTU)
/*
* On Linux, PMTUD is disabled by default for datagrams
* so set the MTU equal to the MIN MTU to get the same.
*/
on = IPV6_MIN_MTU;
if (setsockopt(nsd->udp[i].s, IPPROTO_IPV6, IPV6_MTU,
&on, sizeof(on)) < 0)
{
log_msg(LOG_ERR, "setsockopt(..., IPV6_MTU, ...) failed: %s",
strerror(errno));
return -1;
}
on = 1;
# endif