Bug 1319 - Clarify Ipv4RawSocketImpl ICMP filter limitations

This commit is contained in:
Tommaso Pecorella committed 2012-01-25 19:16:56 +01:00
1 parent eb72daca1f
commit 9e41d4d620
1 file changed
+2 -2
+2 -2
View File
@@ -29,7 +29,7 @@ Ipv4RawSocketImpl::GetTypeId (void)
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_protocol),
MakeUintegerChecker<uint16_t> ())
.AddAttribute ("IcmpFilter",
"Any icmp header whose type field matches a bit in this filter is dropped.",
"Any icmp header whose type field matches a bit in this filter is dropped. Type must be less than 32.",
UintegerValue (0),
MakeUintegerAccessor (&Ipv4RawSocketImpl::m_icmpFilter),
MakeUintegerChecker<uint32_t> ())
@@ -326,7 +326,7 @@ Ipv4RawSocketImpl::ForwardUp (Ptr<const Packet> p, Ipv4Header ipHeader, Ptr<Ipv4
copy->PeekHeader (icmpHeader);
uint8_t type = icmpHeader.GetType ();
if (type < 32 &&
((1 << type) & m_icmpFilter))
((uint32_t(1) << type) & m_icmpFilter))
{
// filter out icmp packet.
return false;