From 6e52efe950783751f57cf97e31eb47046e58f498 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 14 Jan 2017 17:04:17 +0100 Subject: device: refactor setting user-configured MTU during config commit Instead of overwriting ip4_config_pre_commit(), add a new function get_mtu(). This also adds a default value in case there is no user-configuration. This will allow us later to reset a default MTU based on the device type. --- src/devices/nm-device-private.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/devices/nm-device-private.h') diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h index c2ba98f387..7b36ba46f0 100644 --- a/src/devices/nm-device-private.h +++ b/src/devices/nm-device-private.h @@ -118,6 +118,16 @@ void nm_device_ip_method_failed (NMDevice *self, int family, NMDeviceStateReason gboolean nm_device_ipv6_sysctl_set (NMDevice *self, const char *property, const char *value); +/*****************************************************************************/ + +#define NM_DEVICE_DEFAULT_MTU_WIRED ((guint32) 1500) +#define NM_DEVICE_DEFAULT_MTU_WIRELESS ((guint32) 1500) +#define NM_DEVICE_DEFAULT_MTU_INFINIBAND ((guint32) 0) + +guint32 nm_device_get_configured_mtu_for_wired (NMDevice *self, gboolean *out_is_user_config); + +/*****************************************************************************/ + #define NM_DEVICE_CLASS_DECLARE_TYPES(klass, conn_type, ...) \ NM_DEVICE_CLASS (klass)->connection_type = conn_type; \ { \ -- cgit v1.2.1