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

Changeset 4570


Ignore:
Timestamp:
Oct 18, 2009, 3:34:45 PM (8 years ago)
Author:
stud-lenk
Message:

Refined local address selection code.

This change fixes that, for multicast targets, GIST chooses the interface address directed to the standard gateway even if it is NOT an address GIST has been configured for in etc/gist-ka.conf. In this case GIST now prefers the source address specified by the NSLP APImsg, but only if it is an address configured in etc/gist-ka.conf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ntlp/branches/20090723-multicast/src/ntlp_statemodule_api.cpp

    r4491 r4570  
    521521        r_entry->set_local_src(src);
    522522      } else {
     523        DLog(param.name, "APImsg source address: " << src << " (is HA: "
     524                         << param.addresses.addr_is(src, AddressList::HAAddr_P) << ")");
    523525        uint32_t pref = IPV6_PREFER_SRC_COA;
    524526        hostaddress *laddr = param.addresses.get_src_addr(dst, &pref);
    525         DLog(param.name,"Selecting Address: " << src << ", " << *laddr << param.addresses.addr_is(*laddr, AddressList::HAAddr_P) << param.addresses.addr_is(src, AddressList::HAAddr_P));
    526         if (param.addresses.addr_is(*laddr, AddressList::HAAddr_P))
     527        DLog(param.name, "Considering local address: " << *laddr << " (is HA: "
     528                         << param.addresses.addr_is(*laddr, AddressList::HAAddr_P)  << ")");
     529        if (param.addresses.addr_is(*laddr, AddressList::HAAddr_P)) {
    527530          laddr = param.addresses.get_first(AddressList::AltHAAddr_P, src.is_ipv4());
     531          DLog(param.name, "Using alternative home agent address: " << *laddr);
     532        } else {
     533          if (! param.addresses.addr_is(*laddr, AddressList::ConfiguredAddr_P)) {
     534            DLog(param.name, "Address " << *laddr << " is not configured for GIST");
     535            if (param.addresses.addr_is(src, AddressList::ConfiguredAddr_P)) {
     536              DLog(param.name, "but APImsg source address " << src << " is configured for GIST");
     537              laddr = new netaddress(src);
     538            }
     539          }
     540        }
     541        DLog(param.name, "Selected local address: " << *laddr << " (is HA: "
     542                         << param.addresses.addr_is(*laddr, AddressList::HAAddr_P)  << ")");
    528543        //cout << *laddr << endl;
    529544        r_entry->set_local_src(*laddr);
     545        delete laddr;
    530546      }
    531547
Note: See TracChangeset for help on using the changeset viewer.