NSIS-ka
A free C++ implementation of NSIS protocols

Changeset 4101


Ignore:
Timestamp:
Jul 16, 2009, 9:39:40 AM (8 years ago)
Author:
bless
Message:
  • added check for reception of own Query, there will be a warning and it will be ignored
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20080820-configpar/src/ntlp_statemodule_responder.cpp

    r4098 r4101  
    108108          r_entry->nl= new nli(*query_pdu->get_nli());
    109109  }
     110
     111  // check whether this is our own query by comparing the Peer ID
     112  if (r_entry->nl)
     113  {
     114          const peer_identity* pid= r_entry->nl->get_pi();
     115          if (pid && (*pid == *(param.localnliv4.get_pi())) || *pid == *(param.localnliv6.get_pi()))
     116          { // peer id from query nli is the same as ours, this is usually an error
     117                  WLog(param.name,"Detected Query coming from myself, will be ignored and dropped to avoid loopback to myself.");
     118                  delete r_entry;
     119                  return;
     120          }
     121                 
     122  }
     123
    110124  // SII handle in the entry
    111125  r_entry->sii_handle= param.rt.generate_sii_handle(r_entry->nl);
Note: See TracChangeset for help on using the changeset viewer.