face+mgmt: allow congestion marking parameters to be enabled and set
refs #4465
Change-Id: I9d49135ab32bacb2885b70031c573f7c8709ac1f
diff --git a/daemon/face/tcp-channel.cpp b/daemon/face/tcp-channel.cpp
index b6f434d..821c6d7 100644
--- a/daemon/face/tcp-channel.cpp
+++ b/daemon/face/tcp-channel.cpp
@@ -105,9 +105,23 @@
GenericLinkService::Options options;
options.allowLocalFields = params.wantLocalFields;
options.reliabilityOptions.isEnabled = params.wantLpReliability;
- options.allowCongestionMarking = m_wantCongestionMarking;
- auto linkService = make_unique<GenericLinkService>(options);
+ if (boost::logic::indeterminate(params.wantCongestionMarking)) {
+ // Use default value for this channel if parameter is indeterminate
+ options.allowCongestionMarking = m_wantCongestionMarking;
+ }
+ else {
+ options.allowCongestionMarking = params.wantCongestionMarking;
+ }
+
+ if (params.baseCongestionMarkingInterval) {
+ options.baseCongestionMarkingInterval = *params.baseCongestionMarkingInterval;
+ }
+ if (params.defaultCongestionThreshold) {
+ options.defaultCongestionThreshold = *params.defaultCongestionThreshold;
+ }
+
+ auto linkService = make_unique<GenericLinkService>(options);
auto transport = make_unique<TcpTransport>(std::move(socket), params.persistency);
face = make_shared<Face>(std::move(linkService), std::move(transport));