client: set default MTU to 1412 for all interfaces

Since peer endpoints can be either IPv4 or IPv6, it doesn't make sense
to specify a default MTU that could only work with IPv4 based on only
the server's endpoint.

Setting to 1412 instead of 1420 in order to accomodate PPPoE peers,
which should fit most internet situations.
pull/202/head
Jake McGinty 2022-02-05 04:15:28 +09:00
parent a7f7204bd7
commit 83e0750cde
1 changed files with 1 additions and 5 deletions

View File

@ -102,11 +102,7 @@ pub fn up(
set_addr(interface, address)?; set_addr(interface, address)?;
set_up( set_up(
interface, interface,
network.mtu.unwrap_or(if matches!(address, IpNet::V4(_)) { network.mtu.unwrap_or(1412),
1420
} else {
1400
}),
)?; )?;
if !network.no_routing { if !network.no_routing {
add_route(interface, address)?; add_route(interface, address)?;