1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-05 09:17:44 +03:00

Allow bad MTU values with warning to be able to connect to the machine. (#5954)

Ensure the MTU value is valid. Emit a warning and ignore otherwise.
This commit is contained in:
Matthias Greiner 2017-05-22 03:11:25 +02:00 committed by Zbigniew Jędrzejewski-Szmek
parent 7a093ea246
commit 955d99edc7

View File

@ -610,6 +610,11 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void
r = lease_parse_u16(option, len, &lease->mtu, 68);
if (r < 0)
log_debug_errno(r, "Failed to parse MTU, ignoring: %m");
if (lease->mtu < DHCP_DEFAULT_MIN_SIZE) {
log_warning("MTU value of %d too small. Using default MTU value of %d instead.", lease->mtu, DHCP_DEFAULT_MIN_SIZE);
lease->mtu = DHCP_DEFAULT_MIN_SIZE;
}
break;
case SD_DHCP_OPTION_DOMAIN_NAME: