|
Bugzilla – Full Text Bug Listing |
| Summary: | Ipv4Mask constructor for "/yy"-notation is wrong | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Antti Mäkelä <antti.makela> |
| Component: | network | Assignee: | Craig Dowell <craigdo> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | jpelkey, ns-bugs, tomh |
| Priority: | P2 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | patch to fix | ||
Whoops, obviously the bit-shift should be to other direction, so m_mask = 0xffffffff << (32-plen); is correct. Created attachment 733 [details]
patch to fix
IMO, this is ready to commit. Tested (does not change any existing test output). I made a slight adjustment to what was previously posted for the boundary condition of "/0".
+1 on readiness. This is a P5 bug, so theoretically we should not commit until release unless the priority is bumped. (In reply to comment #3) > +1 on readiness. > > This is a P5 bug, so theoretically we should not commit until release unless > the priority is bumped. Craig, can you push this one? changeset 8dcb272f3c00 |
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.