fix type mismatch and bounds checking
authorTom Henderson <tomh@tomh.org>
Thu, 05 Nov 2015 15:48:43 -0800
changeset 11749 a493a939b9b2
parent 11748 505b4c0a2658
child 11750 b989e1719a5a
fix type mismatch and bounds checking
src/internet/model/ip-l4-protocol.cc
--- a/src/internet/model/ip-l4-protocol.cc	Wed Nov 04 18:12:25 2015 -0800
+++ b/src/internet/model/ip-l4-protocol.cc	Thu Nov 05 15:48:43 2015 -0800
@@ -22,7 +22,7 @@
 // George F. Riley, Georgia Tech, Spring 2007
 
 #include "ip-l4-protocol.h"
-#include "ns3/uinteger.h"
+#include "ns3/integer.h"
 #include "ns3/log.h"
 
 namespace ns3 {
@@ -38,9 +38,10 @@
     .SetParent<Object> ()
     .SetGroupName ("Internet")
     .AddAttribute ("ProtocolNumber", "The IP protocol number.",
-                   UintegerValue (0),
-                   MakeUintegerAccessor (&IpL4Protocol::GetProtocolNumber),
-                   MakeUintegerChecker<int> ())
+                   TypeId::ATTR_GET,
+                   IntegerValue (0),
+                   MakeIntegerAccessor (&IpL4Protocol::GetProtocolNumber),
+                   MakeIntegerChecker<int> (0,255))
   ;
   return tid;
 }