47 lines
1.4 KiB
Text
47 lines
1.4 KiB
Text
$NetBSD: patch-ab,v 1.5 2004/12/22 21:07:01 skrll Exp $
|
|
|
|
--- sim_ether.c.orig 2004-03-31 13:38:58.000000000 +0100
|
|
+++ sim_ether.c
|
|
@@ -830,6 +830,15 @@ void eth_callback(u_char* info, const st
|
|
tmp_packet.len = header->len;
|
|
memcpy(tmp_packet.msg, data, header->len);
|
|
|
|
+ /*
|
|
+ * Pad packet to minimum ethernet len, in case it comes from the local
|
|
+ * host.
|
|
+ */
|
|
+ if (header->len < 60) {
|
|
+ tmp_packet.len = 60;
|
|
+ memset(dev->read_packet->msg + header->len, 0, 60 - header->len);
|
|
+ }
|
|
+
|
|
eth_packet_trace (dev, tmp_packet.msg, tmp_packet.len, "rcvqd");
|
|
|
|
pthread_mutex_lock (&dev->lock);
|
|
@@ -840,6 +849,15 @@ void eth_callback(u_char* info, const st
|
|
dev->read_packet->len = header->len;
|
|
memcpy(dev->read_packet->msg, data, header->len);
|
|
|
|
+ /*
|
|
+ * Pad packet to minimum ethernet len, in case it comes from the local
|
|
+ * host.
|
|
+ */
|
|
+ if (header->len <60) {
|
|
+ dev->read_packet->len = 60;
|
|
+ memset(dev->read_packet->msg + header->len, 0, 60 - header->len);
|
|
+ }
|
|
+
|
|
eth_packet_trace (dev, dev->read_packet->msg, dev->read_packet->len, "reading");
|
|
|
|
/* call optional read callback function */
|
|
@@ -1080,8 +1098,10 @@ int eth_host_devices(int used, int max,
|
|
|
|
int eth_devices(int max, ETH_LIST* list)
|
|
{
|
|
+#ifndef DONT_USE_PCAP_FINDALLDEVS
|
|
pcap_if_t* alldevs;
|
|
pcap_if_t* dev;
|
|
+#endif
|
|
int i = 0;
|
|
char errbuf[PCAP_ERRBUF_SIZE];
|
|
|