⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rtl8139-bound-chaining

📁 xen 3.2.2 源码
💻
字号:
# HG changeset patch# User kfraser@localhost.localdomain# Node ID 075f4ffdbbce5527ba525a515abe320703d17a0e# Parent  51edd3c6a4d861db6ce1c9a02251ed49213c3002[QEMU] rtl8139: Disallow chaining above 64KAs it stands the 8139C+ TX chaining is only bounded by realloc failure.This is contrary to how the real hardware operates.  It also has DoSpotential when ioemu runs in dom0.This patch makes any attempt to chain a frame beyond 64K failimmediately.Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>Index: ioemu/hw/rtl8139.c===================================================================--- ioemu.orig/hw/rtl8139.c	2007-05-03 20:36:50.000000000 +0100+++ ioemu/hw/rtl8139.c	2007-05-03 20:39:45.000000000 +0100@@ -1999,12 +1999,12 @@         DEBUG_PRINT(("RTL8139: +++ C+ mode transmission buffer allocated space %d\n", s->cplus_txbuffer_len));     } -    while (s->cplus_txbuffer && s->cplus_txbuffer_offset + txsize >= s->cplus_txbuffer_len)+    if (s->cplus_txbuffer && s->cplus_txbuffer_offset + txsize >= s->cplus_txbuffer_len)     {-        s->cplus_txbuffer_len += CP_TX_BUFFER_SIZE;-        s->cplus_txbuffer = realloc(s->cplus_txbuffer, s->cplus_txbuffer_len);+	free(s->cplus_txbuffer);+	s->cplus_txbuffer = NULL; -        DEBUG_PRINT(("RTL8139: +++ C+ mode transmission buffer space changed to %d\n", s->cplus_txbuffer_len));+	DEBUG_PRINT(("RTL8139: +++ C+ mode transmission buffer space exceeded: %d\n", s->cplus_txbuffer_offset + txsize));     }      if (!s->cplus_txbuffer)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -