Re: torrent sharing

Stu Midgley <[email protected]> Thu, 14 Sep 2017 21:56:19 +0800
Newsgroups gmane.network.lftp.user
Message-ID <CAEM1RsWgDL6d91QfpEyv3OcMhF3_sOfsKnbHTCOB01u0yGBDRA@mail.gmail.com>
--===============0324550540998482684==
Content-Type: multipart/alternative; boundary="001a1149c42e498979055926a5dc"

--001a1149c42e498979055926a5dc
Content-Type: text/plain; charset="UTF-8"

and of course... their was a similar test in dht-bootstrap .

I have removed both tests and they at least talk to each other.

On Thu, Sep 14, 2017 at 9:48 PM, Stu Midgley <[email protected]> wrote:

> Right... and line 743,1131 in DHT.cc and 575,586 in Torrent.cc
>
> I modified the is_private function in network.cc to
>
> bool sockaddr_u::is_private() const
>
> {
>
>    if(sa.sa_family==AF_INET)
>
>    {
>
>       unsigned char *a=(unsigned char *)&in.sin_addr;
>
>       return (0==1);
>
>    }
>
> #if INET6
>
>    if(family()==AF_INET6) {
>
>       return IN6_IS_ADDR_SITELOCAL(&in6.sin6_addr)
>
>           || IN6_IS_ADDR_LINKLOCAL(&in6.sin6_addr);
>
>    }
>
> #endif
>
>    return false;
>
> }
>
>
>
> and it still didn't work.
>
>
> On Thu, Sep 14, 2017 at 9:25 PM, Alexander V. Lukyanov <[email protected]>
> wrote:
>
>> On Thu, Sep 14, 2017 at 09:12:40PM +0800, Stu Midgley wrote:
>> > Thanks for the quick response.
>> >
>> > I started the bootstrap-dht and the lftp client and server on the single
>> > machine (172.16.250.40) which is a machine without external access to
>> the
>> > internet (hence why I want to run my own dht bootstrap service.
>> ...
>> > I don't see lftp contacting the bootstrap service.
>>
>> It appears that lftp refuses to talk DHT to private IP addresses (see
>> DHT.cc:296). I don't know if that's correct, but I was thinking about
>> security of private networks when I coded this.
>>
>> --
>>    Alexander.
>>
>
>
>
> --
> Dr Stuart Midgley
> [email protected]
>



-- 
Dr Stuart Midgley
[email protected]

--001a1149c42e498979055926a5dc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:monospac=
e,monospace">and of course... their was a similar test in dht-bootstrap .</=
div><div class=3D"gmail_default" style=3D"font-family:monospace,monospace">=
<br></div><div class=3D"gmail_default" style=3D"font-family:monospace,monos=
pace">I have removed both tests and they at least talk to each other. =C2=
=A0</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On=
 Thu, Sep 14, 2017 at 9:48 PM, Stu Midgley <span dir=3D"ltr">&lt;<a href=3D=
"mailto:[email protected]" target=3D"_blank">[email protected]</a>&gt;</span>=
 wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div class=3D"gm=
ail_default" style=3D"font-family:monospace,monospace">Right... and line 74=
3,1131 in DHT.cc and 575,586 in Torrent.cc</div><div class=3D"gmail_default=
" style=3D"font-family:monospace,monospace"><br></div><div class=3D"gmail_d=
efault" style=3D"font-family:monospace,monospace">I modified the is_private=
 function in network.cc to</div><div class=3D"gmail_default" style=3D"font-=
family:monospace,monospace"><br></div><div class=3D"gmail_default" style=3D=
"font-family:monospace,monospace"><p style=3D"margin:0px;font-size:11px;lin=
e-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style=3D"font-var=
iant-ligatures:no-common-ligatures">bool sockaddr_u::</span><span style=3D"=
font-variant-ligatures:no-common-ligatures;color:rgb(255,255,255);backgroun=
d-color:rgb(0,0,0)">is_private</span><span style=3D"font-variant-ligatures:=
no-common-ligatures">() const</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">{</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 if(sa.sa_family=3D=3DAF_INET)</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 {</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0 =C2=A0 =C2=A0 unsigned char *a=3D(unsigned char *)&amp;in.sin_addr=
;</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0 =C2=A0 =C2=A0 return (0=3D=3D1);</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 }</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">#if INET6</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 if(family()=3D=3DAF_INET6) {</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0 =C2=A0 =C2=A0 return IN6_IS_ADDR_SITELOCAL(&amp;in6.<wbr>sin6_addr=
)</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 || IN6_IS_ADDR_LINKLOCAL(&amp;in6.<wbr=
>sin6_addr);</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 }</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">#endif</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">=C2=A0=C2=A0 return false;</span></p>
<p style=3D"margin:0px;font-size:11px;line-height:normal;font-family:Menlo;=
color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-common-ligatures=
">}</span></p><p style=3D"margin:0px;font-size:11px;line-height:normal;font=
-family:Menlo;color:rgb(0,0,0)"><span style=3D"font-variant-ligatures:no-co=
mmon-ligatures"><br></span></p><p style=3D"margin:0px;font-size:11px;line-h=
eight:normal;font-family:Menlo;color:rgb(0,0,0)"><span style=3D"font-varian=
t-ligatures:no-common-ligatures"><br></span></p></div><div class=3D"gmail_d=
efault" style=3D"font-family:monospace,monospace">and it still didn&#39;t w=
ork.</div><div class=3D"gmail_default" style=3D"font-family:monospace,monos=
pace"><br></div></div><div class=3D"gmail_extra"><div><div class=3D"h5"><br=
><div class=3D"gmail_quote">On Thu, Sep 14, 2017 at 9:25 PM, Alexander V. L=
ukyanov <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_bl=
ank">[email protected]</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote=
" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><=
span>On Thu, Sep 14, 2017 at 09:12:40PM +0800, Stu Midgley wrote:<br>
&gt; Thanks for the quick response.<br>
&gt;<br>
&gt; I started the bootstrap-dht and the lftp client and server on the sing=
le<br>
&gt; machine (172.16.250.40) which is a machine without external access to =
the<br>
&gt; internet (hence why I want to run my own dht bootstrap service.<br>
</span><span>...<br>
&gt; I don&#39;t see lftp contacting the bootstrap service.<br>
<br>
</span>It appears that lftp refuses to talk DHT to private IP addresses (se=
e<br>
DHT.cc:296). I don&#39;t know if that&#39;s correct, but I was thinking abo=
ut<br>
security of private networks when I coded this.<br>
<br>
--<br>
=C2=A0 =C2=A0Alexander.<br>
</blockquote></div><br><br clear=3D"all"><div><br></div></div></div><span c=
lass=3D"">-- <br><div class=3D"m_-9028386477028631132gmail_signature" data-=
smartmail=3D"gmail_signature"><div dir=3D"ltr"><div><font face=3D"monospace=
, monospace">Dr Stuart Midgley<br><a href=3D"mailto:[email protected]" targe=
t=3D"_blank">[email protected]</a></font></div></div></div>
</span></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><d=
iv><font face=3D"monospace, monospace">Dr Stuart Midgley<br><a href=3D"mail=
to:[email protected]" target=3D"_blank">[email protected]</a></font></div></d=
iv></div>
</div>

--001a1149c42e498979055926a5dc--

--===============0324550540998482684==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
lftp mailing list
[email protected]
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

--===============0324550540998482684==--