From ceb66fb221184eb8f0136ac141ff6c2c8d3245fa Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 21 Jan 2015 05:47:52 +0100 Subject: Always disable PMTU discovery fastd currently can't fragment packets anyways, so it doesn't make any sense to perform PMTU discovery. This makes the config option `pmtu' a no-op. --- src/config.y | 2 +- src/fastd.h | 1 - src/socket.c | 10 ++++------ 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/config.y b/src/config.y index 404ac1d..af93864 100644 --- a/src/config.y +++ b/src/config.y @@ -369,7 +369,7 @@ mtu: TOK_UINT { } ; -pmtu: autobool { conf.pmtu = $1; } +pmtu: autobool ; mode: TOK_TAP { conf.mode = MODE_TAP; } diff --git a/src/fastd.h b/src/fastd.h index 56a099a..b4266ff 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -199,7 +199,6 @@ struct fastd_config { uint32_t packet_mark; /**< The configured packet mark (or 0) */ bool forward; /**< Specifies if packet forwarding is enable */ - fastd_tristate_t pmtu; /**< Can be set to explicitly enable or disable PMTU detection */ bool secure_handshakes; /**< Can be set to false to support connections with fastd versions before v11 */ fastd_drop_caps_t drop_caps; /**< Specifies if and when to drop capabilities */ diff --git a/src/socket.c b/src/socket.c index d464b6e..e932148 100644 --- a/src/socket.c +++ b/src/socket.c @@ -102,12 +102,10 @@ static int bind_socket(const fastd_bind_address_t *addr, bool warn) { #endif #ifdef USE_PMTU - if (conf.pmtu.set) { - int pmtu = conf.pmtu.state ? IP_PMTUDISC_DO : IP_PMTUDISC_DONT; - if (setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu))) { - pr_error_errno("setsockopt: unable to set PMTU discovery"); - goto error; - } + int pmtu = IP_PMTUDISC_DONT; + if (setsockopt(fd, IPPROTO_IP, IP_MTU_DISCOVER, &pmtu, sizeof(pmtu))) { + pr_error_errno("setsockopt: unable to disable PMTU discovery"); + goto error; } #endif -- cgit v1.2.3