SHA256
1
0
forked from pool/dynamips

Accepting request 228409 from home:anubisg1:networking

OBS-URL: https://build.opensuse.org/request/show/228409
OBS-URL: https://build.opensuse.org/package/show/Education/dynamips?expand=0&rev=29
This commit is contained in:
andrea florio 2014-04-01 09:53:04 +00:00 committed by Git OBS Bridge
parent e5d2285507
commit 498e1a06bc
6 changed files with 16 additions and 173 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4278baecf1f6718433722e6f38179a69ec9b2ef02381b31c5d3ef5b8f8f3e94a
size 967525

View File

@ -1,44 +0,0 @@
--- dynamips-0.2.11-source.orig/common/dev_gt.c 2014-02-10 17:50:38.000000000 +0100
+++ dynamips-0.2.11-source.patched/common/dev_gt.c 2014-02-25 07:58:17.000190403 +0100
@@ -328,7 +328,7 @@
#define GT_RXDESC_ES 0x00008000 /* Error Summary */
#define GT_RXDESC_IGMP 0x00004000 /* IGMP packet detected */
#define GT_RXDESC_HE 0x00002000 /* Hash Table Expired */
-#define GT_RXDESC_M 0x00001000 /* Missed Frame */
+#define GT_RXDESC_M 0x00001000 /* Dst MAC Miss in Hash Table */
#define GT_RXDESC_FT 0x00000800 /* Frame Type (802.3/Ethernet) */
#define GT_RXDESC_SF 0x00000100 /* Short Frame Error */
#define GT_RXDESC_MFL 0x00000080 /* Maximum Frame Length Error */
@@ -2354,11 +2354,21 @@
*
* Return values:
* - 0: Discard packet ;
- * - 1: Receive packet ;
- * - 2: Receive packet and set "M" bit in RX descriptor.
+ * - 1: Receive packet but set "M" bit in RX descriptor ;
+ * - 2: Receive packet.
*
* The documentation is not clear about the M bit in RX descriptor.
* It is described as "Miss" or "Match" depending on the section.
+ * However, it turns out that IOS treats the bit as "Miss" bit.
+ * If the bit is set, the destination MAC address has not been found
+ * in the hash table, and the frame may be subject to software MAC
+ * address filter associated by IOS with the interface. If the bit
+ * is clear, the destination MAC address has been found in the hash
+ * table and the frame will be accepted by IOS unconditionally.
+ * The M bit is required to correctly handle unicast frames destined
+ * to other MAC addresses when the interface works in promiscuous mode.
+ * IOS puts an interface into promiscuous mode when multicast routing
+ * or bridging has been configured on it.
*/
static inline int gt_eth_handle_rx_daddr(struct gt_data *d,
struct eth_port *port,
@@ -2474,7 +2484,7 @@
if (hash_res == GT_HTLOOKUP_HOP_EXCEEDED)
rxd0.cmd_stat |= GT_RXDESC_HE;
- if (addr_action == 2)
+ if (addr_action == 1)
rxd0.cmd_stat |= GT_RXDESC_M;
if (ntohs(hdr->type) <= N_ETH_MTU) /* 802.3 frame */

View File

@ -1,120 +0,0 @@
--- dynamips-0.2.11-source.orig/common/dev_gt.c 2014-03-02 15:22:17.881753020 +0100
+++ dynamips-0.2.11-source.patched/common/dev_gt.c 2014-03-02 15:15:55.467367795 +0100
@@ -2093,8 +2093,8 @@
int queue)
{
u_char pkt[GT_MAX_PKT_SIZE],*pkt_ptr;
- struct sdma_desc txd0,ctxd,*ptxd;
- m_uint32_t tx_start,tx_current;
+ struct sdma_desc ctxd;
+ m_uint32_t tx_current;
m_uint32_t len,tot_len;
int abort = FALSE;
@@ -2106,17 +2106,29 @@
return(FALSE);
/* Copy the current txring descriptor */
- tx_start = tx_current = port->tx_current[queue];
+ tx_current = port->tx_current[queue];
- if (!tx_start)
+ if (!tx_current)
return(FALSE);
- ptxd = &txd0;
- gt_sdma_desc_read(d,tx_start,ptxd);
+ gt_sdma_desc_read(d,tx_current,&ctxd);
/* If we don't own the first descriptor, we cannot transmit */
- if (!(txd0.cmd_stat & GT_TXDESC_OWN))
+ if (!(ctxd.cmd_stat & GT_TXDESC_OWN)) {
+ if (queue == 0) {
+ port->icr |= GT_ICR_TXENDL;
+ port->sdcmr |= GT_SDCMR_STDL;
+ port->sdcmr &= ~GT_SDCMR_TXDL;
+
+ } else {
+ port->icr |= GT_ICR_TXENDH;
+ port->sdcmr |= GT_SDCMR_STDH;
+ port->sdcmr &= ~GT_SDCMR_TXDH;
+ }
+
+ gt_eth_update_int_status(d,port);
return(FALSE);
+ }
/* Empty packet for now */
pkt_ptr = pkt;
@@ -2125,43 +2137,41 @@
for(;;) {
#if DEBUG_ETH_TX
GT_LOG(d,"gt_eth_handle_txqueue: loop: "
- "cmd_stat=0x%x, buf_size=0x%x, next_ptr=0x%x, buf_ptr=0x%x\n",
- ptxd->cmd_stat,ptxd->buf_size,ptxd->next_ptr,ptxd->buf_ptr);
+ "tx_current=0x%08x, cmd_stat=0x%08x, buf_size=0x%08x, next_ptr=0x%08x, buf_ptr=0x%08x\n",
+ tx_current, ctxd.cmd_stat, ctxd.buf_size, ctxd.next_ptr, ctxd.buf_ptr);
#endif
- if (!(ptxd->cmd_stat & GT_TXDESC_OWN)) {
+ if (!(ctxd.cmd_stat & GT_TXDESC_OWN)) {
GT_LOG(d,"gt_eth_handle_txqueue: descriptor not owned!\n");
abort = TRUE;
break;
}
/* Copy packet data to the buffer */
- len = (ptxd->buf_size & GT_TXDESC_BC_MASK) >> GT_TXDESC_BC_SHIFT;
+ len = (ctxd.buf_size & GT_TXDESC_BC_MASK) >> GT_TXDESC_BC_SHIFT;
- physmem_copy_from_vm(d->vm,pkt_ptr,ptxd->buf_ptr,len);
+ physmem_copy_from_vm(d->vm,pkt_ptr,ctxd.buf_ptr,len);
pkt_ptr += len;
tot_len += len;
- /* Clear the OWN bit if this is not the first descriptor */
- if (!(ptxd->cmd_stat & GT_TXDESC_F)) {
- ptxd->cmd_stat &= ~GT_TXDESC_OWN;
- physmem_copy_u32_to_vm(d->vm,tx_current,ptxd->cmd_stat);
+ /* Clear the OWN bit if this is not the last descriptor */
+ if (!(ctxd.cmd_stat & GT_TXDESC_L)) {
+ ctxd.cmd_stat &= ~GT_TXDESC_OWN;
+ physmem_copy_u32_to_vm(d->vm,tx_current+4,ctxd.cmd_stat);
}
- tx_current = ptxd->next_ptr;
-
/* Last descriptor or no more desc available ? */
- if (ptxd->cmd_stat & GT_TXDESC_L)
+ if (ctxd.cmd_stat & GT_TXDESC_L)
break;
- if (!tx_current) {
+ if (!(ctxd.next_ptr)) {
abort = TRUE;
break;
}
/* Fetch the next descriptor */
+ tx_current = ctxd.next_ptr;
gt_sdma_desc_read(d,tx_current,&ctxd);
- ptxd = &ctxd;
}
if ((tot_len != 0) && !abort) {
@@ -2180,11 +2190,11 @@
port->tx_frames++;
}
- /* Clear the OWN flag of the first descriptor */
- txd0.cmd_stat &= ~GT_TXDESC_OWN;
- physmem_copy_u32_to_vm(d->vm,tx_start+4,txd0.cmd_stat);
+ /* Clear the OWN flag of the last descriptor */
+ ctxd.cmd_stat &= ~GT_TXDESC_OWN;
+ physmem_copy_u32_to_vm(d->vm,tx_current+4,ctxd.cmd_stat);
- port->tx_current[queue] = tx_current;
+ port->tx_current[queue] = tx_current = ctxd.next_ptr;
/* Notify host about transmitted packet */
if (queue == 0)

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b8a60c2ff577ec3a5c2b892bce654a68cc072c79fbca2b708d36d42bd3e9eb12
size 995877

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Apr 1 11:35:00 UTC 2014 - andrea@opensuse.org
- new upstream version 0.2.12
* Fixed all known multicast issues. Patches by Peter Palúch.
* New hypervisor command:
- vm_debug pmem_cfind <instance_name> <cpu_id> <bytes> [<first> [<last>]]
* Fixed issue #29
* Closed issue #31
- removed multicast patches now merged in upstream code
-------------------------------------------------------------------
Mon Mar 3 17:15:00 UTC 2014 - andrea@opensuse.org

View File

@ -17,7 +17,7 @@
Name: dynamips
Version: 0.2.11
Version: 0.2.12
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{defined fedora}
@ -37,8 +37,6 @@ BuildRequires: glibc-32bit
%endif
%endif
Source: http://sourceforge.net/projects/gns-3/files/Dynamips/%{version}/%{name}-%{version}-source.zip
Patch0: %{name}-%{version}_fix_M_bit.patch
Patch1: %{name}-%{version}_fix_mcast_queue.patch
Summary: Cisco router Emulator
License: GPL-2.0+
Group: System/Emulators/Other
@ -53,9 +51,7 @@ simply a complementary tool to real labs for administrators of Cisco networks
or people wanting to pass their CCNA/CCNP/CCIE exams.
%prep
%setup -q -n %{name}-%{version}-source
%patch0 -p1
%patch1 -p1
%setup -q
%build
%ifarch x86_64