Running PC/TCP inside DosEmu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, 
I've been traying to run a DOS application inside DosEmu 1.4.0. That
application uses the PC/TCP drivers to implement a TCP/IP stack and
network comunications.
I could make the application work with no problem using the "direct"
mode, but because we need to contact applications inside the same linux
machine that was running the DosEmu box we have to move to the "tap"
virtual network option. From that moment we couldn't stablish any
connection from inside the DosEmu box. 
I start to debug the DosEmu code and found out that the packages that
come from the TAP driver were pased to the DOS application without
problems, but the connections from inside the DOS application could not
be stablished. I also analyze the TAP code to see if I could found the
problem (I also get in touch with the TUN/TAP mantainer) but I didn't
found any problem there.
So, after some research I reach to the conclution that, for some rason
the PC/TCP driver was dropping tha packets that arrive to the DosEmu
Box. After digging more on the network traffic I could found the
problem.
The problem is that in the Ethernet specification says that no ethernet
frame can be shorter than 60 bytes. The TAP driver relays on the
internal kernel functions to build the frames, and the internal kernel
functions relays on the network card driver to fix the ethernet size
before putting it on the cable... so, because the TAP doesn't have any
"card driver" the TAP can generate packets shorter than 60 bytes and the
PC/TCP driver (and I think that many more DOS native TCP/IP
implementations) droppes them. An example of a packet that is shorter
than 60 bytes is the ARP replay... so you start with the wrong foot.
Any case, I write a few code lines inside the DosEmu packet driver code
to fix this.
I'm attaching that code in the mail in case you wan't to include them
for the nex release or whatever. 
I'm also in contact with the TUN/TAP team (I also write a fix for the
TUN/TAP) to see if they want to fix this on the TAP driver, but I don't
think they will include it there.

So, this are my 2 cents, hope that this may help some one. Please let me
know your thoughts about this.

regards, Mauro Flores
--- dosemu-1.4.0_fix/src/dosext/net/net/pktnew.c	2008-07-29 23:08:59.000000000 -0300
+++ dosemu-1.4.0/src/dosext/net/net/pktnew.c	2007-05-04 02:59:48.000000000 -0300
@@ -709,17 +709,6 @@
 		*--p = (char)(ETH_P_IPX >> 8);
 	    }
 #endif
-
-		/* The TAP driver can send ethernet frames shorter than 60 bytes that may be dropped for the DOS
-		 * stack implementation. This will fix the packet size adding a trailer at the end. by almauri@xxxxxxxxx 
-		 */
-
-		if( size < ETH_ZLEN ) { 
-	    	pd_printf("Fixing packet padding. Actual length: %d\n", size);
-			memset( pkt_buf+size, '0', ETH_ZLEN-size );
-			size = ETH_ZLEN;
-		}
-
 	    p_stats->packets_in++;
 	    p_stats->bytes_in += size;
 

[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux