[Ns-bugs] [Bug 336] optimized build doesn't compile on Ubuntu 8.10

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Thu Sep 11 07:42:29 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=336





------- Comment #5 from raj.b at gatech.edu  2008-09-11 10:42 -------
One solution is to conditionally FATAL_ERROR out if somehow the read from
/dev/random fails.

diff -r 3a4021da265d src/core/random-variable.cc
--- a/src/core/random-variable.cc       Thu Sep 11 15:21:19 2008 +0100
+++ b/src/core/random-variable.cc       Thu Sep 11 10:41:46 2008 -0400
@@ -198,7 +198,10 @@
             {
               ssize_t bytes_read = read (RandomVariableBase::devRandom,
                                          &seeds[i], sizeof (seeds[i]));
-              NS_ASSERT (bytes_read == sizeof (seeds[i]));
+              if (bytes_read != sizeof (seeds[i]))
+              {
+                NS_FATAL_ERROR ("Read from /dev/random failed");
+              }
             }
           if (RngStream::CheckSeed(seeds)) break; // Got a valid one
         }


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list