From cf66227f0d775b4545aafb9a0d569cc1de159deb Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 12 Nov 2009 01:59:53 +0000 Subject: [PATCH] (trunk libT) #2573: Don't send BT_PORT messages over IPv6 --- libtransmission/peer-msgs.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 3b4868a47..3d88c7c93 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -2125,8 +2125,14 @@ tr_peerMsgsNew( struct tr_torrent * torrent, if( tr_peerIoSupportsLTEP( peer->io ) ) sendLtepHandshake( m ); - if(tr_peerIoSupportsDHT(peer->io)) - protocolSendPort(m, tr_dhtPort(torrent->session)); + if(tr_peerIoSupportsDHT(peer->io)) { + /* We don't have an IPv6 DHT yet. + * According to BEP-32, we can't send PORT over IPv6. */ + const struct tr_address *addr = tr_peerIoGetAddress( peer->io, NULL ); + if( addr->type == TR_AF_INET ) { + protocolSendPort( m, tr_dhtPort( torrent->session ) ); + } + } tellPeerWhatWeHave( m );