ppp-manager: initialize MTU to zero when not specified

When the MTU was not specified in PPP setting, it got the value of a
previous option.

Fixes: 8f36727ac8
This commit is contained in:
Beniamino Galvani 2016-01-04 16:51:19 +01:00
parent ac7a6d0206
commit 986cf3a887

View file

@ -433,10 +433,11 @@ set_ip_config_common (NMPPPManager *self,
applied_connection = nm_act_request_get_applied_connection (priv->act_req);
g_object_set_data (G_OBJECT (applied_connection), PPP_MANAGER_SECRET_TRIES, NULL);
/* Get any custom MTU */
s_ppp = nm_connection_get_setting_ppp (applied_connection);
if (s_ppp && out_mtu)
*out_mtu = nm_setting_ppp_get_mtu (s_ppp);
if (out_mtu) {
/* Get any custom MTU */
s_ppp = nm_connection_get_setting_ppp (applied_connection);
*out_mtu = s_ppp ? nm_setting_ppp_get_mtu (s_ppp) : 0;
}
monitor_stats (self);
return TRUE;