VOGONS

Common searches


First post, by Zorix

User metadata
Rank Newbie
Rank
Newbie

Hi everyone.

I was having trouble today with a friend playing Rise of the Triad over modem. The setup.exe modem configuration section would not accept dots or semicolons in the dialer such as: 192.168.1.10:5000. I then tried: 1921680010105000 which dosbox then converted to 192.168.001.010:5000 and would not connect. Testing with Telix confirmed that it works using the dots and semicolon. Only thing I could think of is that the system didn't know how to handle the 0's in the octets. I checked the source code and created a small modification that removed the 0's and tested with success. This was tested on Ubuntu 10.04 and 12.04 with newest SVN release. I have created a diff that you all may find useful. Let me know what you all think about it. Thank you.

--- softmodem.cpp.original	2013-08-25 15:12:21.757106249 -0400
+++ softmodem.cpp 2013-08-25 15:39:11.505100981 -0400
@@ -385,6 +385,19 @@
}
buffer[j] = 0;
foundstr = buffer;
+ // Remove Zeros from beginning of octets
+ char obuffer[128];
+ Bitu k = 0;
+ for (Bitu i=0; i<strlen(foundstr); i++) {
+ if (i < 2 && foundstr[i] == 0)
+ continue;
+ if (foundstr[i] == '0' && foundstr[i-1] == '.')
+ continue;
+ if (foundstr[i] == '0' && foundstr[i-1] == '0' && foundstr[i-2] == '.')
+ continue;
+ obuffer[k++] = foundstr[i];
+ }
+ foundstr = obuffer;
}
}
Dial(foundstr);

Reply 3 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I am a bit surprised that this would be needed and wonder if it is needed only on Linux.
Aside from that. I would say that IPs that start with 101 would get translated to 11 , with this patch ? (the first if).

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 8, by Zorix

User metadata
Rank Newbie
Rank
Newbie

Hi Qbix,

Thanks for looking at my suggested patch. I found an error with the patch. That whole first if statement is invalid. foundstr == 0 should be foundstr == '0' which does as you expect if it was written right. Turns out that I don't even need that check since the other if's are looking for the period in the octet anyways. However, I did encounter more problems when testing with something such as 012.101.101.001 for example. I adjusted it by adding this check in place of the first if statement:

[code]
if (i == 0 && foundstr == '0')
continue;
if (i == 1 && foundstr[i-1] == '0' && foundstr == '0')
continue;
[/code]

and it now behaves as it should.

Let me know what you think.

Also, this issue was originally encountered between a Windows 7 machine connecting to my Ubuntu 12.04 machine. Since the dialer part was handled on the Windows 7 side initially, this problem seemed to have been an issue there as well. However, during my testing I was using two Ubuntu 12.04 machines. An application such as Telix can be used to test further. However, I don't own any Windows machines, so I couldn't test. But the suggested change wouldn't impact how the Windows machines would function, even if it wasn't affected to begin with.

Thanks.

Last edited by Zorix on 2013-11-06, 15:04. Edited 1 time in total.

Reply 7 of 8, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I commited a modified version of it in r3843, improving a few things and fixing a few possible bugs (no trailing zero, increasing buffers scope until the dail command).

Please test if it works for you.

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 8, by Zorix

User metadata
Rank Newbie
Rank
Newbie

I have just compiled it and tested on Ubuntu 12.04 and also with 10.04 and I can confirm that it works perfectly. Thank you for taking the time to address this. I am really pleased.

Zorix