summaryrefslogtreecommitdiffstats
path: root/src/fastd.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-25 11:36:40 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-25 11:36:40 +0200
commitaaa2e11810cfcb724a24154ee311cd9e702ba799 (patch)
tree07d5e9052dd5d122ac4adfdb0fac76d9def3366d /src/fastd.c
parent8345c5c33fbed90a1d79fcd0756ade66aca2fcc9 (diff)
downloadfastd-aaa2e11810cfcb724a24154ee311cd9e702ba799.tar
fastd-aaa2e11810cfcb724a24154ee311cd9e702ba799.zip
Set IP_MTU_DISCOVER on sockets
Diffstat (limited to 'src/fastd.c')
-rw-r--r--src/fastd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/fastd.c b/src/fastd.c
index 43b0a0a..a142cb2 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -245,6 +245,14 @@ static int bind_socket(fastd_context_t *ctx, const fastd_bind_address_t *addr, b
}
}
+ if (ctx->conf->pmtu.set) {
+ int pmtu = ctx->conf->pmtu.state ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT;
+ if (setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu))) {
+ pr_error_errno(ctx, "setsockopt: unable to set PMTU discovery");
+ goto error;
+ }
+ }
+
fastd_peer_address_t bind_address = addr->addr;
if (bind_address.sa.sa_family == AF_UNSPEC) {