summaryrefslogtreecommitdiff
path: root/src/ppp-manager/nm-ppp-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ppp-manager/nm-ppp-manager.c')
-rw-r--r--src/ppp-manager/nm-ppp-manager.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/ppp-manager/nm-ppp-manager.c b/src/ppp-manager/nm-ppp-manager.c
index fc05602194..809ef61f0b 100644
--- a/src/ppp-manager/nm-ppp-manager.c
+++ b/src/ppp-manager/nm-ppp-manager.c
@@ -857,6 +857,7 @@ create_pppd_cmd_line (NMPPPManager *self,
const char *pppd_binary = NULL;
NMCmdLine *cmd;
gboolean ppp_debug;
+ guint32 mru, mtu, mxu = 0;
g_return_val_if_fail (setting != NULL, NULL);
@@ -864,6 +865,9 @@ create_pppd_cmd_line (NMPPPManager *self,
if (!pppd_binary)
return NULL;
+ mru = nm_setting_ppp_get_mru (setting);
+ mtu = nm_setting_ppp_get_mru (setting);
+
/* Create pppd command line */
cmd = nm_cmd_line_new ();
nm_cmd_line_add_string (cmd, pppd_binary);
@@ -906,6 +910,8 @@ create_pppd_cmd_line (NMPPPManager *self,
nm_cmd_line_add_string (cmd, "rp_pppoe_service");
nm_cmd_line_add_string (cmd, pppoe_service);
}
+
+ mxu = mru > mtu ? mru : mtu;
} else if (adsl) {
const gchar *protocol = nm_setting_adsl_get_protocol (adsl);
@@ -931,6 +937,8 @@ create_pppd_cmd_line (NMPPPManager *self,
nm_cmd_line_add_string (cmd, "plugin");
nm_cmd_line_add_string (cmd, "rp-pppoe.so");
nm_cmd_line_add_string (cmd, priv->parent_iface);
+
+ mxu = mru > mtu ? mru : mtu;
}
nm_cmd_line_add_string (cmd, "noipdefault");
@@ -940,6 +948,9 @@ create_pppd_cmd_line (NMPPPManager *self,
nm_cmd_line_add_string (cmd, "noipdefault");
}
+ if (mxu && mxu > 1492)
+ nm_platform_link_set_mtu (nm_platform_link_get_ifindex (priv->parent_iface), mxu + 8);
+
if (nm_setting_ppp_get_baud (setting))
nm_cmd_line_add_int (cmd, nm_setting_ppp_get_baud (setting));
@@ -979,12 +990,12 @@ create_pppd_cmd_line (NMPPPManager *self,
*/
nm_cmd_line_add_string (cmd, "usepeerdns");
- if (nm_setting_ppp_get_mru (setting)) {
+ if (mru) {
nm_cmd_line_add_string (cmd, "mru");
nm_cmd_line_add_int (cmd, nm_setting_ppp_get_mru (setting));
}
- if (nm_setting_ppp_get_mtu (setting)) {
+ if (mtu) {
nm_cmd_line_add_string (cmd, "mtu");
nm_cmd_line_add_int (cmd, nm_setting_ppp_get_mtu (setting));
}