Skip to content

Commit

Permalink
Always disable PMTU discovery
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
neocturne committed Jan 21, 2015
1 parent eece452 commit ceb66fb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/config.y
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ mtu: TOK_UINT {
}
;

pmtu: autobool { conf.pmtu = $1; }
pmtu: autobool
;

mode: TOK_TAP { conf.mode = MODE_TAP; }
Expand Down
1 change: 0 additions & 1 deletion src/fastd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
10 changes: 4 additions & 6 deletions src/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ceb66fb

Please sign in to comment.