summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-01-21 05:47:52 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-01-21 05:47:52 +0100
commitceb66fb221184eb8f0136ac141ff6c2c8d3245fa (patch)
tree03f616b4ae3099092b2f5a9d22c28c2b1ef87d22 /src
parenteece4529cbc27eb8266cd9f47cf84c0d0a6b742a (diff)
downloadfastd-ceb66fb221184eb8f0136ac141ff6c2c8d3245fa.tar
fastd-ceb66fb221184eb8f0136ac141ff6c2c8d3245fa.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/config.y2
-rw-r--r--src/fastd.h1
-rw-r--r--src/socket.c10
3 files changed, 5 insertions, 8 deletions
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