summaryrefslogtreecommitdiff
path: root/emulators/simh/patches/patch-ab
blob: 48ccaee8cab21fa952af29cb862207cfc640bd43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$NetBSD: patch-ab,v 1.4 2003/05/31 16:10:53 thorpej Exp $

--- sim_ether.c.orig	2003-01-16 09:45:04.000000000 -0800
+++ sim_ether.c	2003-05-31 08:51:54.000000000 -0700
@@ -383,6 +383,14 @@
     /* set data in passed read packet */
     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);
+    }
 
 #ifdef ETH_DEBUG
     eth_packet_trace (dev->read_packet, "reading");