Project

General

Profile

Bug #1356

Updated by Junxiao Shi about 10 years ago

Environment: Ubuntu 12.04   
 ndn-cpp-dev commit c145d492e98ffc7949a80c551bc7188afd074635   
 NFD commit eee71fd6bca6e49115989a64ac75bfc71b324e5d 

 Steps to reproduce: 

 1. in NFD configuration file, grant `fib` privilege to default identity 
 2. start NFD, and wait about 5 seconds 
 3. run program `NFD=1 ./a.out` 

		 // g++ set-controller.cpp -lndn-cpp-dev -pthread -lboost_system -lboost_filesystem -lcrypto -lcryptopp -lsqlite3 -lrt 

		 #include <ndn-cpp-dev/face.hpp> 
		 #include <ndn-cpp-dev/management/nfd-controller.hpp> 

		 using ndn::Name; 
		 using ndn::Interest; 
		 using ndn::Face; 

		 void 
		 onInterest(const Name& name, const Interest& interest) 
		 { 
		   std::cout << "interest " << interest.getName() << std::endl; 
		 } 

		 void 
		 onRegisterFailed(const Name& prefix, const std::string& reason) 
		 { 
		   std::cout << prefix << " fail " << reason << std::endl; 
		 } 

		 int 
		 main() 
		 { 
		   Face face; 
		   face.setController(boost::make_shared<ndn::nfd::Controller>(boost::ref(face))); 
		   face.setInterestFilter("/localhost/set-controller", &onInterest, &onRegisterFailed); 
		  
		   face.processEvents(); 
		  
		   return 0; 
		 } 

 4. if "/localhost/set-controller fail Unauthorized command" appears, terminate and run the program again 

 Expected: no error message   
 Actual: "Unauthorized command" occurs about 4~7 times 

 Note: if `face.setController` line is commented out, "Unauthorized command" occurs 2~3 times 

 Note: if "Unauthorized command" stops appearing, subsequent execution of the program won't have this error message 

Back