Fix the setting and getting of the MTU.
When using AF_INET6 sockets the getting of the MTU was off
by 20 and for AF_CONN sockets the setting and getting was off
by 12.
This is related to issue
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 323376 2017-09-09 20:44:56Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 325284 2017-11-01 16:32:11Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -3063,7 +3063,12 @@ sctp_getopt(struct socket *so, int optname, void *optval, size_t *optsize,
#endif
#ifdef INET6
case AF_INET6:
- paddrp->spp_pathmtu -= SCTP_MIN_V4_OVERHEAD;
+ paddrp->spp_pathmtu -= SCTP_MIN_OVERHEAD;
+ break;
+#endif
+#if defined(__Userspace__)
+ case AF_CONN:
+ paddrp->spp_pathmtu -= sizeof(struct sctphdr);
break;
#endif
default:
@@ -6142,6 +6147,11 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
case AF_INET6:
net->mtu += SCTP_MIN_OVERHEAD;
break;
+#endif
+#if defined(__Userspace__)
+ case AF_CONN:
+ net->mtu += sizeof(struct sctphdr);
+ break;
#endif
default:
break;
@@ -6285,6 +6295,11 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
case AF_INET6:
net->mtu += SCTP_MIN_OVERHEAD;
break;
+#endif
+#if defined(__Userspace__)
+ case AF_CONN:
+ net->mtu += sizeof(struct sctphdr);
+ break;
#endif
default:
break;
