networkd: DHCP client do not get into a loop while setting MTU (#7460)

Some devices get reset itself while setting the MTU. we get in to a LOOP .
Once the MTU changed then the DHCP client talking with DHCP server never stops.
networkd gets into a loop and generates endless DHCP requests.

fixes #6593
fixes #7380
This commit is contained in:
Susant Sahani 2017-11-26 19:51:45 +05:30 committed by Zbigniew Jędrzejewski-Szmek
parent 3f19974091
commit 97e7fb39a8
2 changed files with 11 additions and 0 deletions

View File

@ -1314,6 +1314,8 @@ int link_set_mtu(Link *link, uint32_t mtu) {
if (r < 0)
return log_link_error_errno(link, r, "Could not send rtnetlink message: %m");
link->setting_mtu = true;
link_ref(link);
return 0;
@ -1660,6 +1662,11 @@ static int link_acquire_conf(Link *link) {
assert(link);
if (link->setting_mtu) {
link->setting_mtu = false;
return 0;
}
r = link_acquire_ipv4_conf(link);
if (r < 0)
return r;
@ -3101,6 +3108,9 @@ static int link_carrier_lost(Link *link) {
assert(link);
if (link->setting_mtu)
return 0;
r = link_stop_clients(link);
if (r < 0) {
link_enter_failed(link);

View File

@ -110,6 +110,7 @@ typedef struct Link {
bool ipv4ll_route:1;
bool static_configured;
bool setting_mtu;
LIST_HEAD(Address, pool_addresses);