From owner-freebsd-net Sun Oct 14 20:54:50 2001 Delivered-To: freebsd-net@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id 8FA6037B406 for ; Sun, 14 Oct 2001 20:54:46 -0700 (PDT) Received: from mailhost.feral.com (mjacob@mailhost.feral.com [192.67.166.1]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id f9F3sjH11286 for ; Sun, 14 Oct 2001 20:54:45 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Sun, 14 Oct 2001 20:54:45 -0700 (PDT) From: Matthew Jacob X-Sender: mjacob@beppo Reply-To: mjacob@feral.com To: freebsd-net@freebsd.org Subject: (resend/redo) of BRIDGE patches Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org can somebody help test these? It compiles well, etc... but I haven't quite got the setup at the moment to really do this as I'd have to tear down a current infrastructure that's in the middle of some long term tests. Can sombody try these and make it does what it's supposed to? They should... =================================================================== RCS file: /home/ncvs/src/sys/net/bridge.c,v retrieving revision 1.40 diff -u -r1.40 bridge.c --- net/bridge.c 2001/10/12 18:04:44 1.40 +++ net/bridge.c 2001/10/15 03:53:38 @@ -556,16 +556,16 @@ * for outgoing packets from ether_output(). */ BDG_STAT(ifp, BDG_IN); - switch ((int)dst) { - case (int)BDG_BCAST: - case (int)BDG_MCAST: - case (int)BDG_LOCAL: - case (int)BDG_UNKNOWN: - case (int)BDG_DROP: + switch ((uintptr_t)dst) { + case (uintptr_t) BDG_BCAST: + case (uintptr_t) BDG_MCAST: + case (uintptr_t) BDG_LOCAL: + case (uintptr_t) BDG_UNKNOWN: + case (uintptr_t) BDG_DROP: BDG_STAT(ifp, dst); break ; default : - if (dst == ifp || dropit ) + if (dst == ifp || dropit) BDG_STAT(ifp, BDG_DROP); else BDG_STAT(ifp, BDG_FORWARD); @@ -649,7 +649,7 @@ ifp = dst ; once = 1 ; } - if ( (u_int)(ifp) <= (u_int)BDG_FORWARD ) + if (ifp <= BDG_FORWARD) panic("bdg_forward: bad dst"); /* Index: net/bridge.h =================================================================== RCS file: /home/ncvs/src/sys/net/bridge.h,v retrieving revision 1.8 diff -u -r1.8 bridge.h --- net/bridge.h 2001/10/05 05:45:26 1.8 +++ net/bridge.h 2001/10/15 03:53:38 @@ -92,8 +92,9 @@ *((unsigned int *)(a)) == 0xffffffff && \ ((unsigned short *)(a))[2] == 0xffff ) #else -#warning... must complete these for the alpha etc. -#define BDG_MATCH(a,b) (!bcmp(a, b, ETHER_ADDR_LEN) ) +/* Unaligned access versions. */ +#define BDG_MATCH(a,b) (!bcmp(a, b, ETHER_ADDR_LEN) ) +#define IS_ETHER_BROADCAST(a) (!bcmp(a, "\377\377\377\377\377\377", 6)) #endif /* * The following constants are not legal ifnet pointers, and are used @@ -127,7 +128,7 @@ } ; -#define BDG_STAT(ifp, type) bdg_stats.s[ifp->if_index].p_in[(int)type]++ +#define BDG_STAT(ifp, type) bdg_stats.s[ifp->if_index].p_in[(long)type]++ #ifdef _KERNEL typedef struct ifnet *bridge_in_t(struct ifnet *, struct ether_header *); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message