Hi.
Your proposed change seems ok. AI_ADDRCONFIG should protect us from using a non-configured protocol stack. But together with AI_PASSIVE it can lead to an error, where we like to have the ANY address even without a configured interface.
I will put this in our repository.
Thank you!
Johannes
Am Freitag, den 02.11.2012, 09:24 +0000 schrieb 고석갑:
Hello, I'm using Ubuntu 10.04.4 64bit. However, I found a result. If I set AF_INET6 and AI_ADDRCONFIG as ai_flags, getaddrinfo returned -2. So, I modified ibrdtn source (ibrcommon/ibrcommon/net/socket.cpp) as the following.
void tcpserversocket::bind(const vaddress &addr) throw (socket_exception) { struct addrinfo hints, *res; memset(&hints, 0, sizeof hints);
hints.ai_family = _family; hints.ai_socktype = SOCK_STREAM; if(_family == AF_INET6) //
SGSG hints.ai_flags = AI_PASSIVE; // SGSG else // SGSG hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
void udpsocket::bind(const vaddress &addr) throw (socket_exception) { struct addrinfo hints, *res; memset(&hints, 0, sizeof hints);
hints.ai_family = _family; hints.ai_socktype = SOCK_DGRAM; if(_family == AF_INET6) //
SGSG hints.ai_flags = AI_PASSIVE; // SGSG else // SGSG hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE;
After I modified it, now dtnd is working. (Even I didn't test it enough yet.)
Thank you.