Module Name: src
Committed By: snj
Date: Fri May 1 01:54:09 UTC 2009
Modified Files:
src/sys/dev/ic [netbsd-5]: hme.c
Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #595):
sys/dev/ic/hme.c: revision 1.70
Replace incorrect local ether_cmp() function with memcmp(9)
on checking multicast addresses, which is not so critical.
Noticed by FUKAUMI Naoki.
To generate a diff of this commit:
cvs rdiff -u -r1.66.10.1 -r1.66.10.2 src/sys/dev/ic/hme.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/hme.c
diff -u src/sys/dev/ic/hme.c:1.66.10.1 src/sys/dev/ic/hme.c:1.66.10.2
--- src/sys/dev/ic/hme.c:1.66.10.1 Fri May 1 01:52:56 2009
+++ src/sys/dev/ic/hme.c Fri May 1 01:54:09 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: hme.c,v 1.66.10.1 2009/05/01 01:52:56 snj Exp $ */
+/* $NetBSD: hme.c,v 1.66.10.2 2009/05/01 01:54:09 snj Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.66.10.1 2009/05/01 01:52:56 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.66.10.2 2009/05/01 01:54:09 snj Exp $");
/* #define HMEDEBUG */
@@ -111,8 +111,6 @@
int hme_rint(struct hme_softc *);
int hme_tint(struct hme_softc *);
-static int ether_cmp(u_char *, u_char *);
-
/* Default buffer copy routines */
void hme_copytobuf_contig(struct hme_softc *, void *, int, int);
void hme_copyfrombuf_contig(struct hme_softc *, void *, int, int);
@@ -642,22 +640,6 @@
}
/*
- * Compare two Ether/802 addresses for equality, inlined and unrolled for
- * speed.
- */
-static inline int
-ether_cmp(a, b)
- u_char *a, *b;
-{
-
- if (a[5] != b[5] || a[4] != b[4] || a[3] != b[3] ||
- a[2] != b[2] || a[1] != b[1] || a[0] != b[0])
- return (0);
- return (1);
-}
-
-
-/*
* Routine to copy from mbuf chain to transmit buffer in
* network buffer memory.
* Returns the amount of data copied.
@@ -1553,7 +1535,7 @@
ETHER_FIRST_MULTI(step, ec, enm);
while (enm != NULL) {
- if (ether_cmp(enm->enm_addrlo, enm->enm_addrhi)) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
/*
* We must listen to a range of multicast addresses.
* For now, just accept all multicasts, rather than