summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nsd/xfrd-tcp.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2016-06-24 08:34:02 +0000
committerflorian <florian@openbsd.org>2016-06-24 08:34:02 +0000
commit275a8d899e6ba7e61052b65d3c7abe38db9a32dc (patch)
tree5ce9fc7264a20d348a71d21e01af2edd1700ec8c /usr.sbin/nsd/xfrd-tcp.c
parentAvoid multiple evaluation of macro arguments in softclock() (diff)
downloadwireguard-openbsd-275a8d899e6ba7e61052b65d3c7abe38db9a32dc.tar.xz
wireguard-openbsd-275a8d899e6ba7e61052b65d3c7abe38db9a32dc.zip
Update to 4.1.10
Testing by millert@, sthen@ and me. came up with the same diff & OK sthen@
Diffstat (limited to 'usr.sbin/nsd/xfrd-tcp.c')
-rw-r--r--usr.sbin/nsd/xfrd-tcp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.sbin/nsd/xfrd-tcp.c b/usr.sbin/nsd/xfrd-tcp.c
index 2949e5a4d0b..9bc01d3ed72 100644
--- a/usr.sbin/nsd/xfrd-tcp.c
+++ b/usr.sbin/nsd/xfrd-tcp.c
@@ -13,6 +13,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
+#include "nsd.h"
#include "xfrd-tcp.h"
#include "buffer.h"
#include "packet.h"
@@ -524,6 +525,19 @@ xfrd_tcp_open(xfrd_tcp_set_t* set, struct xfrd_tcp_pipeline* tp,
return 0;
}
+ if(xfrd->nsd->outgoing_tcp_mss > 0) {
+#if defined(IPPROTO_TCP) && defined(TCP_MAXSEG)
+ if(setsockopt(fd, IPPROTO_TCP, TCP_MAXSEG,
+ (void*)&xfrd->nsd->outgoing_tcp_mss,
+ sizeof(xfrd->nsd->outgoing_tcp_mss)) < 0) {
+ log_msg(LOG_ERR, "xfrd: setsockopt(TCP_MAXSEG)"
+ "failed: %s", strerror(errno));
+ }
+#else
+ log_msg(LOG_ERR, "setsockopt(TCP_MAXSEG) unsupported");
+#endif
+ }
+
tp->ip_len = xfrd_acl_sockaddr_to(zone->master, &tp->ip);
/* bind it */