|
Zbigniew Jędrzejewski-Szmek |
d743bb |
From 557d5e9fecff500b010a9be44dda1ae000f45039 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
From: Matthias Greiner <magreiner@users.noreply.github.com>
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
Date: Mon, 22 May 2017 03:11:25 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
Subject: [PATCH] Allow bad MTU values with warning to be able to connect to
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
the machine. (#5954)
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
Ensure the MTU value is valid. Emit a warning and ignore otherwise.
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
(cherry picked from commit 955d99edc7991386a36e3d33924cc584931fde91)
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
---
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
src/libsystemd-network/sd-dhcp-lease.c | 5 +++++
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
1 file changed, 5 insertions(+)
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
index 7fed55c5fc..565ec4cbe4 100644
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
--- a/src/libsystemd-network/sd-dhcp-lease.c
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+++ b/src/libsystemd-network/sd-dhcp-lease.c
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
@@ -594,6 +594,11 @@ int dhcp_lease_parse_options(uint8_t code, uint8_t len, const void *option, void
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
r = lease_parse_u16(option, len, &lease->mtu, 68);
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
if (r < 0)
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
log_debug_errno(r, "Failed to parse MTU, ignoring: %m");
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+ if (lease->mtu < DHCP_DEFAULT_MIN_SIZE) {
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+ log_warning("MTU value of %d too small. Using default MTU value of %d instead.", lease->mtu, DHCP_DEFAULT_MIN_SIZE);
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+ lease->mtu = DHCP_DEFAULT_MIN_SIZE;
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+ }
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
+
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
|
|
Zbigniew Jędrzejewski-Szmek |
d743bb |
case SD_DHCP_OPTION_DOMAIN_NAME:
|