From d3d9794802036703a23b050d67f6ef159b499c2a Mon Sep 17 00:00:00 2001 From: rd235 Date: Fri, 9 Jun 2006 15:24:25 +0000 Subject: [PATCH] FST packets filtering (vde/vde2 compatibility issue) git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@89 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde/doc/slirpvde.1 | 2 +- vde/port.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/vde/doc/slirpvde.1 b/vde/doc/slirpvde.1 index 75cd045..a031fbb 100644 --- a/vde/doc/slirpvde.1 +++ b/vde/doc/slirpvde.1 @@ -63,7 +63,7 @@ all the units connected to the VDE. \fB-netaddr\fP is used to specify the network address (default 10.0.2.0). Slirpvde connects all the units (virtual or real machines) to the network -of the network where slirpvde runs as it were a NAT/Masquerading router. +of the host where slirpvde runs as it were a NAT/Masquerading router. The default route is the node 2 (10.0.2.2 in the default network configuration) and DNS is re-mapped in node 3 (10.0.2.3). diff --git a/vde/port.c b/vde/port.c index bbaaec3..33c8c8d 100644 --- a/vde/port.c +++ b/vde/port.c @@ -161,6 +161,14 @@ static void send_dst(struct port *port, struct packet *packet, int len, register int i; target = find_in_hash(packet->header.dest); + /*fprintf(stderr,"%02x:%02x:%02x:%02x:%02x:%02x -> %02x:%02x:%02x:%02x:%02x:%02x %p\n", + packet->header.src[0], packet->header.src[1], + packet->header.src[2], packet->header.src[3], + packet->header.src[4], packet->header.src[5], + packet->header.dest[0], packet->header.dest[1], + packet->header.dest[2], packet->header.dest[3], + packet->header.dest[4], packet->header.dest[5], + target);*/ if((target == NULL) || IS_BROADCAST(packet->header.dest) || hub){ #ifdef INFO if((target == NULL) && !IS_BROADCAST(packet->header.dest)){ @@ -202,6 +210,10 @@ static void send_dst(struct port *port, struct packet *packet, int len, } } +#define BPDUADDR {0x01,0x80,0xc2,0x00,0x00,0x00} +static unsigned char bpduaddrp[]=BPDUADDR; +#define ISBPDU(P) (memcmp((P)->header.dest,bpduaddrp,ETH_ALEN)==0) + /* we have received a packet of data; take the packet 'packet' of size 'len' * and send it to port 'p', acting as a hub if asked for. if p is NULL, then we * assume that data comes from no known source (this should not happen) */ @@ -214,8 +226,10 @@ static void handle_direct_data (struct port *p, int hub, struct packet *packet, printlog(LOG_WARNING,"Unknown connection for packet, shouldn't happen."); } #endif - - send_dst(p, packet, len, hub); + /* throw away FSP packets: VDE1 is unable to manage FSP, run VDE2 instead + * ;-) */ + if (!ISBPDU(packet)) + send_dst(p, packet, len, hub); } -- 2.11.4.GIT