ether_crc32_[bl]e()

M. Warner Losh imp at bsdimp.com
Mon May 31 10:30:01 PDT 2004


In message: <c9d9u3$o6k$1 at kemoauc.mips.inka.de>
            naddy at mips.inka.de (Christian Weisgerber) writes:
: NetBSD and OpenBSD have two helper functions in if_ethersubr.c
: 
: ether_crc32_le(const u_int8_t *buf, size_t len)
------------------------^^^^^^^^ uint8_t
: ether_crc32_be(const u_int8_t *buf, size_t len)
------------------------^^^^^^^^ uint8_t

: These CRCs are used all over our network drivers, e.g. for setting
: up multicast hash filters.  Functions to calculate them are duplicated
: all over.  These could be factored out of some thirty drivers.
: NetBSD has done so, btw.
...

The other comment that I have about this stuff is to make sure that if
you are directly copying these routines form somewhere, you make sure
that you give proper credit in the if_ethersubr.c file.

: +ether_crc32_be(const u_int8_t *buf, size_t len)
------------------------^^^^^^^^ uint8_t

Warner


More information about the freebsd-arch mailing list