Description: the Linux TAP driver can send packets that the DOS PC/TCP stack thinks are invalid (e.g. ARP replies). This pads the packet to avoid the problem. Author: Mauro Flores Origin: http://www.spinics.net/lists/linux-msdos/msg00821.html Bug-Upstream: http://sourceforge.net/p/dosemu/bugs/550/ Index: dosemu-1.4.0.7+20130105+b028d3f/src/dosext/net/net/pktnew.c =================================================================== --- dosemu-1.4.0.7+20130105+b028d3f.orig/src/dosext/net/net/pktnew.c 2013-01-05 09:08:12.000000000 -0800 +++ dosemu-1.4.0.7+20130105+b028d3f/src/dosext/net/net/pktnew.c 2015-06-18 11:16:17.233137549 -0700 @@ -706,6 +706,18 @@ *--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 by adding padding at the end. + */ + 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;