diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fastd.c | 8 | ||||
-rw-r--r-- | src/fastd.h | 1 |
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; |