mgmt+face: allow MTU of datagram faces to be overridden
refs #4005
Change-Id: I01d98b88cdee41b633f6fb9a5600088efe8de749
diff --git a/daemon/face/udp-factory.cpp b/daemon/face/udp-factory.cpp
index 3660db5..e649871 100644
--- a/daemon/face/udp-factory.cpp
+++ b/daemon/face/udp-factory.cpp
@@ -270,6 +270,13 @@
return;
}
+ if (req.params.mtu && *req.params.mtu < Transport::MIN_MTU) {
+ // The specified MTU must be greater than the minimum possible
+ NFD_LOG_TRACE("createFace cannot create a face with MTU less than " << Transport::MIN_MTU);
+ onFailure(406, "MTU cannot be less than " + to_string(Transport::MIN_MTU));
+ return;
+ }
+
// very simple logic for now
for (const auto& i : m_channels) {
if ((i.first.address().is_v4() && endpoint.address().is_v4()) ||