Project

General

Profile

Actions

Bug #1356

closed

Face::setInterestFilter likely to fail if setController has been called

Added by Junxiao Shi about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
03/14/2014
Due date:
% Done:

100%

Estimated time:

Description

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


Related issues 1 (0 open1 closed)

Blocked by NFD - Bug #1365: NFD doesn't build with ndn-cpp-dev aa0e7dadClosedAlex Afanasyev03/18/2014

Actions
Actions

Also available in: Atom PDF