From owner-freebsd-hackers Wed Sep 2 18:16:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA13693 for freebsd-hackers-outgoing; Wed, 2 Sep 1998 18:16:53 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA13688 for ; Wed, 2 Sep 1998 18:16:51 -0700 (PDT) (envelope-from tlambert@usr07.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id SAA08901; Wed, 2 Sep 1998 18:15:48 -0700 (MST) Received: from usr07.primenet.com(206.165.6.207) via SMTP by smtp03.primenet.com, id smtpd008873; Wed Sep 2 18:15:42 1998 Received: (from tlambert@localhost) by usr07.primenet.com (8.8.5/8.8.5) id SAA03007; Wed, 2 Sep 1998 18:15:39 -0700 (MST) From: Terry Lambert Message-Id: <199809030115.SAA03007@usr07.primenet.com> Subject: Re: bcmp abuse in networking code ? To: archie@whistle.com (Archie Cobbs) Date: Thu, 3 Sep 1998 01:15:39 +0000 (GMT) Cc: luigi@labinfo.iet.unipi.it, hackers@FreeBSD.ORG In-Reply-To: <199809030053.RAA20948@bubba.whistle.com> from "Archie Cobbs" at Sep 2, 98 05:53:33 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > In my revised bridge code i have the following macros > > > > #define ETH_MATCH(a,b) ( \ > > ((unsigned short *)(a))[2] == ((unsigned short *)(b))[2] && \ > > *((unsigned int *)(a)) == *((unsigned int *)(b)) ) > > #define IS_ETHER_BROADCAST(a) ( \ > > *((unsigned int *)(a)) == 0xffffffff && \ > > ((unsigned short *)(a))[2] == 0xffff ) > > Cool...! > > A minor nit, though: use u_int16_t and u_int32_t instead. No, not cool. See http://www.daemonnews.org/underhood.html The New Link-Level Independent ARP Subsystem of NetBSD Ignatios Souvatis The NetBSD Project Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message