[Ns-bugs] [Bug 794] New: Ipv4Mask constructor for "/yy"-notation is wrong

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Wed Jan 20 00:23:30 PST 2010


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

           Summary: Ipv4Mask constructor for "/yy"-notation is wrong
           Product: ns-3
           Version: pre-release
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: node module
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: zarhan at cc.hut.fi
   Estimated Hours: 0.0


In src/node/ipv4-address.cc, line 71 and onwards,

The constructor should be:

Ipv4Mask::Ipv4Mask (char const *mask)
{
  if (*mask == ASCII_SLASH)
    {
      uint32_t plen = static_cast<uint32_t> (atoi (++mask));
      NS_ASSERT (plen <= 32);
      m_mask = 0xffffffff >> (32-plen);
    }
  else
    {
      m_mask = AsciiToIpv4Host (mask);
    }
}

Right now it just places the prefix length, as is, to m_mask, ending up with
some rather weird results.

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


More information about the Ns-bugs mailing list