WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix a protocol violation in the pcnet emulation. Tested

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix a protocol violation in the pcnet emulation. Tested on at least
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Mar 2006 12:08:07 +0000
Delivery-date: Mon, 20 Mar 2006 12:09:32 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID a8b1d4fad72d2b0bba1b121bc250b4ac80fcf9ac
# Parent  056e571ce462d44612f2300ff17f589b2e43368b
Fix a protocol violation in the pcnet emulation.  Tested on at least
two systems and fixes the 'corrupt MAC' with scp or sftp.  See bug 574
for more information.

Signed-off-by:  Don Fry <brazilnut@xxxxxxxxxx>

diff -r 056e571ce462 -r a8b1d4fad72d tools/ioemu/hw/pcnet.h
--- a/tools/ioemu/hw/pcnet.h    Mon Mar 20 11:00:58 2006
+++ b/tools/ioemu/hw/pcnet.h    Mon Mar 20 11:01:32 2006
@@ -225,9 +225,11 @@
         ((uint32_t *)tmd)[3] = 0;
     }
     else
-    if (BCR_SWSTYLE(s) != 3)
-        cpu_physical_memory_read(addr, (void *)tmd, 16);
-    else {
+    if (BCR_SWSTYLE(s) != 3) {
+        ((uint32_t *)tmd)[2] = 0;
+        cpu_physical_memory_read(addr+4, (void *)&tmd->tmd1, 4);
+        cpu_physical_memory_read(addr, (void *)&tmd->tmd0, 4);
+    } else {
         uint32_t xda[4];
         cpu_physical_memory_read(addr,
                 (void *)&xda[0], sizeof(xda));
@@ -253,9 +255,10 @@
         cpu_physical_memory_set_dirty(addr+7);
     }
     else {
-        if (BCR_SWSTYLE(s) != 3)
-            cpu_physical_memory_write(addr, (void *)tmd, 16);
-        else {
+        if (BCR_SWSTYLE(s) != 3) {
+            cpu_physical_memory_write(addr+8, (void *)&tmd->tmd2, 4);
+            cpu_physical_memory_write(addr+4, (void *)&tmd->tmd1, 4);
+        } else {
             uint32_t xda[4];
             xda[0] = ((uint32_t *)tmd)[2];
             xda[1] = ((uint32_t *)tmd)[1];
@@ -282,9 +285,11 @@
         ((uint32_t *)rmd)[3] = 0;
     }
     else
-    if (BCR_SWSTYLE(s) != 3)
-        cpu_physical_memory_read(addr, (void *)rmd, 16);
-    else {
+    if (BCR_SWSTYLE(s) != 3) {
+        rmd->rmd2.zeros = 0;
+        cpu_physical_memory_read(addr+4, (void *)&rmd->rmd1, 4);
+        cpu_physical_memory_read(addr, (void *)&rmd->rmd0, 4);
+    } else {
         uint32_t rda[4];
         cpu_physical_memory_read(addr,
                 (void *)&rda[0], sizeof(rda));
@@ -310,9 +315,10 @@
         cpu_physical_memory_set_dirty(addr+7);
     }
     else {
-        if (BCR_SWSTYLE(s) != 3)
-            cpu_physical_memory_write(addr, (void *)rmd, 16);
-        else {
+        if (BCR_SWSTYLE(s) != 3) {
+            cpu_physical_memory_write(addr+8, (void *)&rmd->rmd2, 4);
+            cpu_physical_memory_write(addr+4, (void *)&rmd->rmd1, 4);
+        } else {
             uint32_t rda[4];
             rda[0] = ((uint32_t *)rmd)[2];
             rda[1] = ((uint32_t *)rmd)[1];
@@ -339,8 +345,7 @@
 #define CHECK_RMD(ADDR,RES) do {                \
     struct pcnet_RMD rmd;                       \
     RMDLOAD(&rmd,(ADDR));                       \
-    (RES) |= (rmd.rmd1.ones != 15)              \
-          || (rmd.rmd2.zeros != 0);             \
+    (RES) |= (rmd.rmd1.ones != 15);             \
 } while (0)
 
 #define CHECK_TMD(ADDR,RES) do {                \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix a protocol violation in the pcnet emulation. Tested on at least, Xen patchbot -unstable <=