Changeset 11528


Ignore:
Timestamp:
07/22/11 08:46:55 (13 years ago)
Author:
tbretz
Message:
Replace a v6 loopback address by a v4 loopback address; we do not support v6.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Connection.cc

    r11479 r11528  
    457457}
    458458
    459 void Connection::SetEndpoint(const boost::asio::ip::tcp::endpoint &ep)
    460 {
    461     SetEndpoint(ep.address().to_string(), ep.port());
    462     fEndpoint = ep;
     459void Connection::SetEndpoint(const tcp::endpoint &ep)
     460{
     461    const ba::ip::address addr = ep.address();
     462
     463    const ba::ip::address use =
     464        addr.is_v6() && addr.to_v6().is_loopback() ?
     465        ba::ip::address(ba::ip::address_v4::loopback()) :
     466        addr;
     467
     468    SetEndpoint(use.to_string(), ep.port());
     469
     470    fEndpoint = tcp::endpoint(use, ep.port());
    463471}
    464472
Note: See TracChangeset for help on using the changeset viewer.