--- a/RELEASE_NOTES Sun May 20 17:15:43 2018 +0200
+++ b/RELEASE_NOTES Sun May 20 17:16:27 2018 +0200
@@ -32,6 +32,7 @@
Bugs fixed
----------
+- Bug 2911 - aodv: Binary exponential backoff can become unlimited
- Bug 2901 - Add CommandLine::Parse (const std::vector<std::string>> args)
- Bug 2461 - CommandLine should handle non-option arguments
- Bug 2801 - FdNetDevice device MTU is not set correctly
--- a/src/aodv/model/aodv-routing-protocol.cc Sun May 20 17:15:43 2018 +0200
+++ b/src/aodv/model/aodv-routing-protocol.cc Sun May 20 17:16:27 2018 +0200
@@ -1100,8 +1100,10 @@
}
else
{
- // Binary exponential backoff
- retry = std::pow<uint16_t> (2, rt.GetRreqCnt () - 1) * m_netTraversalTime;
+ NS_ABORT_MSG_UNLESS (rt.GetRreqCnt () > 0, "Unexpected value for GetRreqCount ()");
+ uint16_t backoffFactor = rt.GetRreqCnt () - 1;
+ NS_LOG_LOGIC ("Applying binary exponential backoff factor " << backoffFactor);
+ retry = m_netTraversalTime * (1 << backoffFactor);
}
m_addressReqTimer[dst].Schedule (retry);
NS_LOG_LOGIC ("Scheduled RREQ retry in " << retry.GetSeconds () << " seconds");
--- a/wscript Sun May 20 17:15:43 2018 +0200
+++ b/wscript Sun May 20 17:16:27 2018 +0200
@@ -30,11 +30,8 @@
examples_enabled = False
tests_enabled = False
-# Compiler warning suppressions
-
-# Bug 1868: be conservative about -Wstrict-overflow for optimized builds
-# on older compilers; it can generate spurious warnings.
-gcc_version_warn_strict_overflow = ('4', '8', '2')
+# GCC minimum version requirements for C++11 support
+gcc_min_version = (4, 9, 2)
# Bug 2181: clang warnings about unused local typedefs and potentially
# evaluated expressions affecting darwin clang/LLVM version 7.0.0 (Xcode 7)
@@ -391,6 +388,11 @@
env['APPNAME'] = wutils.APPNAME
env['VERSION'] = wutils.VERSION
+ if conf.env['CXX_NAME'] in ['gcc']:
+ if tuple(map(int, conf.env['CC_VERSION'])) < gcc_min_version:
+ conf.fatal('gcc version %s older than minimum supported version %s' %
+ ('.'.join(conf.env['CC_VERSION']), '.'.join(map(str, gcc_min_version))))
+
if conf.env['CXX_NAME'] in ['gcc', 'icc']:
if Options.options.build_profile == 'release':
env.append_value('CXXFLAGS', '-fomit-frame-pointer')
@@ -398,7 +400,7 @@
if conf.check_compilation_flag('-march=native'):
env.append_value('CXXFLAGS', '-march=native')
env.append_value('CXXFLAGS', '-fstrict-overflow')
- if conf.env['CC_VERSION'] >= gcc_version_warn_strict_overflow:
+ if conf.env['CXX_NAME'] in ['gcc']:
env.append_value('CXXFLAGS', '-Wstrict-overflow=2')
if sys.platform == 'win32':