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

Changeset 4205


Ignore:
Timestamp:
Aug 5, 2009, 11:22:46 AM (8 years ago)
Author:
bless
Message:
  • this should fix ticket #122: response on refreshing query was sent to wrong address (the internal one) instead of the NAT'S public address (translated NLI).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20081127-merge-mobility-mk3/src/ntlp_statemodule_responder.cpp

    r4204 r4205  
    541541
    542542  // MUST CHECK with different NLI and r_key if NTO is present...
     543  // we need to store the translated NLI in our routing entry, because
     544  // responses have to go back to this external NAT address
    543545  nli* translated_nli= responder_cookie->get_nli();
    544546  nli* peer_nli= translated_nli ? translated_nli : cnfpdu->get_nli();
     
    11511153  // note that in case of gist aware-NAT traversal an initial query carries the translated NLI (external addr)
    11521154  // and further refreshing queries carry untranslated addresses (local/internal addr)
     1155  // for MA lookup we'll always use the untranslated NLI
    11531156  nli* qnli= pdu ? pdu->get_nli() : r_entry->nl;
    11541157
     
    11871190
    11881191    response_dest= new appladdress;
    1189        
     1192 
     1193    // for NAT traversal scenario: must try translated NLI information first
     1194    if (r_entry->translated_nli)
     1195    { // must sent back to NAT public address
     1196        response_dest->set_ip(r_entry->translated_nli->get_if_address());
     1197    }
     1198    else
    11901199    if (pdu)
    1191     {
     1200    { // should use most current information from PDU
    11921201      if (pdu->get_nli())
    11931202        response_dest->set_ip(pdu->get_nli()->get_if_address());
    11941203    }
    11951204    else
    1196     {
     1205    { // use what we already know from routing entry
    11971206      if (r_entry->nl)
    11981207        response_dest->set_ip(r_entry->nl->get_if_address());
Note: See TracChangeset for help on using the changeset viewer.