Skip to content
Snippets Groups Projects
Commit d033e175 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Ethernet MAC addresses (macaddr type) are not compared correctly for

equality.  The lobits macro is wrong and extracts the wrong set of
bits out of the structure.

To exhibit the problem:

select '000000:000000'::macaddr = '000000:110000'::macaddr ;
?column?
--------
t
(1 row)

Daniel Boyd
parent 7585deb0
No related branches found
No related tags found
No related merge requests found
/*
* PostgreSQL type definitions for MAC addresses.
*
* $Id: mac.c,v 1.13 1999/07/17 20:17:57 momjian Exp $
* $Id: mac.c,v 1.14 1999/12/16 01:30:49 momjian Exp $
*/
......@@ -132,7 +132,7 @@ manufacturer manufacturers[] = {
((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))
#define lobits(addr) \
((unsigned long)((addr->c<<16)|(addr->e<<8)|(addr->f)))
((unsigned long)((addr->d<<16)|(addr->e<<8)|(addr->f)))
/*
* MAC address reader. Accepts several common notations.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment