From 7d137e3ffb9f873f301def92f781d7837a7c480b Mon Sep 17 00:00:00 2001 From: mjacob Date: Fri, 19 Oct 2001 18:29:57 +0000 Subject: [PATCH] Fix this so it compiles cleanly for alpha. Tried to do some minimal testing. Reviewed by: freebsd-net --- sys/net/bridge.c | 16 ++++++++-------- sys/net/bridge.h | 7 ++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/net/bridge.c b/sys/net/bridge.c index d4f6fa3cfab4..f0c5ab95ea3b 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -556,16 +556,16 @@ bridge_in(struct ifnet *ifp, struct ether_header *eh) * 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 @@ bdg_forward(struct mbuf *m0, struct ether_header *const eh, struct ifnet *dst) ifp = dst ; once = 1 ; } - if ( (u_int)(ifp) <= (u_int)BDG_FORWARD ) + if (ifp <= BDG_FORWARD) panic("bdg_forward: bad dst"); /* diff --git a/sys/net/bridge.h b/sys/net/bridge.h index 82db1caa014b..be71d86897fe 100644 --- a/sys/net/bridge.h +++ b/sys/net/bridge.h @@ -92,8 +92,9 @@ extern int bdg_ports ; *((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 @@ struct bdg_stats { } ; -#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 *);