mirror of https://github.com/bochs-emu/Bochs
- apply Peter Tattam's patch that makes win32 pad packets up to 60 bytes
This commit is contained in:
parent
05ac22063b
commit
91cc6590b2
|
@ -1,5 +1,5 @@
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: eth_win32.cc,v 1.9 2002-03-08 18:46:54 bdenney Exp $
|
||||
// $Id: eth_win32.cc,v 1.10 2002-04-18 00:33:58 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
|
@ -323,6 +323,7 @@ void bx_win32_pktmover_c::rx_timer_handler (void *this_ptr)
|
|||
unsigned char *pPacket;
|
||||
unsigned int iOffset = 0;
|
||||
struct bpf_hdr *hdr;
|
||||
int pktlen;
|
||||
static unsigned char bcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
PacketInitPacket(pkRecv, (char *)buffer, 256000);
|
||||
PacketReceivePacket(lpAdapter, pkRecv, TRUE);
|
||||
|
@ -337,7 +338,9 @@ void bx_win32_pktmover_c::rx_timer_handler (void *this_ptr)
|
|||
if(memcmp(pPacket, cMacAddr, 6) == 0 || memcmp(pPacket, bcast_addr, 6) == 0)
|
||||
{
|
||||
fprintf(stderr, "[ETH-WIN32] RX packet: size=%i, dst=%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, src=%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", hdr->bh_caplen, pPacket[0], pPacket[1], pPacket[2], pPacket[3], pPacket[4], pPacket[5], pPacket[6], pPacket[7], pPacket[8], pPacket[9], pPacket[10], pPacket[11]);
|
||||
(*rx_handler)(rx_Arg, pPacket, hdr->bh_caplen);
|
||||
pktlen = hdr->bh_caplen;
|
||||
if (pktlen < 60) pktlen = 60;
|
||||
(*rx_handler)(rx_Arg, pPacket, pktlen);
|
||||
}
|
||||
}
|
||||
iOffset = Packet_WORDALIGN(iOffset + (hdr->bh_hdrlen + hdr->bh_caplen));
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
Index: iodev/eth_win32.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/iodev/eth_win32.cc,v
|
||||
retrieving revision 1.9
|
||||
diff -u -r1.9 eth_win32.cc
|
||||
--- iodev/eth_win32.cc 8 Mar 2002 18:46:54 -0000 1.9
|
||||
+++ iodev/eth_win32.cc 18 Apr 2002 00:32:03 -0000
|
||||
@@ -323,6 +323,7 @@
|
||||
unsigned char *pPacket;
|
||||
unsigned int iOffset = 0;
|
||||
struct bpf_hdr *hdr;
|
||||
+ int pktlen;
|
||||
static unsigned char bcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
PacketInitPacket(pkRecv, (char *)buffer, 256000);
|
||||
PacketReceivePacket(lpAdapter, pkRecv, TRUE);
|
||||
@@ -337,7 +338,9 @@
|
||||
if(memcmp(pPacket, cMacAddr, 6) == 0 || memcmp(pPacket, bcast_addr, 6) == 0)
|
||||
{
|
||||
fprintf(stderr, "[ETH-WIN32] RX packet: size=%i, dst=%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x, src=%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", hdr->bh_caplen, pPacket[0], pPacket[1], pPacket[2], pPacket[3], pPacket[4], pPacket[5], pPacket[6], pPacket[7], pPacket[8], pPacket[9], pPacket[10], pPacket[11]);
|
||||
- (*rx_handler)(rx_Arg, pPacket, hdr->bh_caplen);
|
||||
+ pktlen = hdr->bh_caplen;
|
||||
+ if (pktlen < 60) pktlen = 60;
|
||||
+ (*rx_handler)(rx_Arg, pPacket, pktlen);
|
||||
}
|
||||
}
|
||||
iOffset = Packet_WORDALIGN(iOffset + (hdr->bh_hdrlen + hdr->bh_caplen));
|
Loading…
Reference in New Issue