shill: add minimum-mtu command-line parameter
Add the --minimum-mtu option to shill to allow clients to override small
MTU values set by DHCP servers. Any MTU value smaller than the provided
one is dropped.
BUG=chrome-os-partner:36886
TEST=FEATURES=test emerge-amd64-generic shill, ASAN profile
Change-Id: I8e79a18f335705887568e04050712d565d53c4f0
Reviewed-on: https://chromium-review.googlesource.com/263522
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Garret Kelly <gdk@chromium.org>
Tested-by: Garret Kelly <gdk@chromium.org>
diff --git a/manager.h b/manager.h
index 84d8e62..164b0f9 100644
--- a/manager.h
+++ b/manager.h
@@ -61,7 +61,8 @@
: offline_mode(false),
portal_check_interval_seconds(0),
arp_gateway(true),
- connection_id_salt(0) {}
+ connection_id_salt(0),
+ minimum_mtu(IPConfig::kUndefinedMTU) {}
bool offline_mode;
std::string check_portal_list;
std::string country;
@@ -84,6 +85,8 @@
std::string prepend_dns_servers;
// Salt value use for calculating network connection ID.
int connection_id_salt;
+ // The minimum MTU value that will be respected in DHCP responses.
+ int minimum_mtu;
};
Manager(ControlInterface *control_interface,
@@ -334,6 +337,9 @@
bool GetArpGateway() const { return props_.arp_gateway; }
const std::string &GetHostName() const { return props_.host_name; }
+ virtual int GetMinimumMTU() const { return props_.minimum_mtu; }
+ void SetMinimumMTU(const int mtu) { props_.minimum_mtu = mtu; }
+
virtual void UpdateEnabledTechnologies();
virtual void UpdateUninitializedTechnologies();