DCC Send Not Using Configured IP/Port

Discussion about the official XChat for Windows.

DCC Send Not Using C

Postby Cartan » 20 Jan 2007 19:14

Hi!

I'm having a problem with DCC. I think this problem also occurs on Linux, but at the moment, I can only test on Windows. Here it goes:

Background: My router is somewhat strange insofar as DCC SEND will work if and only if xchat uses the correct LAN address! Thank God, I have a fixed IP here, which is 192.168.0.42
So, my configuration looks like this:

dcc_auto_chat = 0
dcc_auto_resume = 1
dcc_auto_send = 0
dcc_blocksize = 1024
dcc_completed_dir =
dcc_dir = C:\Dokumente und Einstellungen\cartan\Eigene Dateien\Downloads
dcc_fast_send = 1
dcc_global_max_get_cps = 0
dcc_global_max_send_cps = 0
dcc_ip = 192.168.0.42
dcc_ip_from_server = 0

dcc_max_get_cps = 0
dcc_max_send_cps = 0
dcc_permissions = 384
dcc_port_first = 9000
dcc_port_last = 9010

dcc_remove = 0
dcc_save_nick = 0
dcc_send_fillspaces = 1
dcc_server = 0
dcc_server_port = 59
dcc_stall_timeout = 60
dcc_timeout = 180


Now, if only xchat sent 192.168.0.42 in its DCC offer, my router would NAT that up and everything would work. Unfortunately, it doesn't! I checked with ethereal, and what it does send is an IP address 199, port 0! And that won't work. "Get IP address from server" does work, insofar as xchat will send the correct IP/port combo, but my router doesn't like that, not even with static NAT settings.

This is a bug, right?
Don't ask for whom the <CTRL> tolls.
Cartan
 
Posts: 6
Joined: 10 Apr 2005 14:17

Postby Cartan » 20 Jan 2007 19:16

Oh, I forgot: I've just upgraded to 2.8.1 (Windows), and the problem is still there. I also had it with 2.6.3.
Don't ask for whom the <CTRL> tolls.
Cartan
 
Posts: 6
Joined: 10 Apr 2005 14:17

Postby peterz » 21 Jan 2007 01:15

1) You need to set dcc_ip to your real internet address, NOT 192.168.*.*.

2) Set your router to forward TCP port range 9000-9010 from 192.168.0.42.3.

3) Nope, no bug :)
User avatar
peterz
 
Posts: 1035
Joined: 09 Jun 2004 13:51
Location: Australia

Postby Cartan » 21 Jan 2007 15:13

If it worked with the real internet address, I could just configure "Get IP address from server". But it doesn't. Let me explain:

If xchat did what I told it to do, i.e., send a DCC SEND with 192.168.0.42, then the router would see this request and replace 192.168.0.42 with its real internet address (and a new port) on its own. (It does this in its NAT module). Then, when my buddy's IRC client makes the TCP connect to my router's real internet address and the new port, the router realizes that this TCP connect belongs to the DCC SEND request it had modified earlier (the router remembers this in an object called "NAT instance"), and will then re-route this TCP connect to 192.168.0.42 and the port (9000) I had originally used.

Now, if I put my real internet address into dcc_ip, or just used "Get IP address from server", then the router would still see the DCC SEND and try to do the same, standard NAT thing it always does. So, the TCP connect from my buddy comes in, but now, in its internal NAT instance, it does not see 192.168.0.42 anymore, but its own external internet address. So, now it doesn't know where to forward the connect, and the whole thing fails.

For this reason, I want to set dcc_ip to my local LAN address 192.168.0.42. And all would work just dandy if only xchat actually used this configured IP address. But it doesn't! It sends 0.0.0.199 instead, and a port number of 0.

To verify it, just configure it the way I described and then use ethereal to see the packet that xchat actually sends out onto the wire.

For your convenience, I have made an ethereal trace that you can find here.

The only interesting packet is the first. The DCC line xchat sends out reads

PRIVMSG buddy :\001DCC SEND 05_Night_Life.m4a 199 0 3146084 192\001


199 is the IP, 0 is the port, and this is not what I have configured.

Bug, right? :)
Don't ask for whom the <CTRL> tolls.
Cartan
 
Posts: 6
Joined: 10 Apr 2005 14:17

Postby Cartan » 21 Jan 2007 17:41

Hmm, browsing source code a little, I found these lines in outbound.c:

Code: Select all
   if ((addr & 0xffff0000) == 0xc0a80000 ||   /* 192.168.x.x */
       (addr & 0xff000000) == 0x0a000000)      /* 10.x.x.x */
      /* we got a private net address, let's PSEND or it'll fail */
      snprintf (tbuf, 512, "DCC PSEND %s", word_eol[2]);
   else
      snprintf (tbuf, 512, "DCC SEND %s", word_eol[2]);

and later on, dcc_send will produce 199 0 because it's "passive."

I think this is wrong. Not only are there other private addresses (172.20.3.68 for example), why override the user's configuration in this way? In my case, it fails because of the PSEND override :) And what if the IRC server is on the local LAN?
Don't ask for whom the <CTRL> tolls.
Cartan
 
Posts: 6
Joined: 10 Apr 2005 14:17

Postby DimaX » 21 Jan 2007 18:20

peterz wrote:1) You need to set dcc_ip to your real internet address, NOT 192.168.*.*.

2) Set your router to forward TCP port range 9000-9010 from 192.168.0.42.3.

3) Nope, no bug :)Image Image
Image
Image Image


Thanks had this problem too...
Dima Popovski
DimaX
 
Posts: 1
Joined: 21 Jan 2007 16:57


Return to XChat for Windows

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 0 guests