summaryrefslogtreecommitdiffstats
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
parent8345c5c33fbed90a1d79fcd0756ade66aca2fcc9 (diff)
downloadfastd-aaa2e11810cfcb724a24154ee311cd9e702ba799.tar
fastd-aaa2e11810cfcb724a24154ee311cd9e702ba799.zip
Set IP_MTU_DISCOVER on sockets
-rw-r--r--src/fastd.c8
-rw-r--r--src/fastd.h1
2 files changed, 9 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) {
diff --git a/src/fastd.h b/src/fastd.h
index 474fd1f..2e92013 100644
--- a/src/fastd.h
+++ b/src/fastd.h
@@ -195,6 +195,7 @@ struct fastd_config {
fastd_mode_t mode;
bool forward;
+ fastd_tristate_t pmtu;
fastd_drop_caps_t drop_caps;