Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d033e17

Browse files
committed
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
1 parent 7585deb commit d033e17

File tree

1 file changed

+2
-2
lines changed
  • src/backend/utils/adt

1 file changed

+2
-2
lines changed

src/backend/utils/adt/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* PostgreSQL type definitions for MAC addresses.
33
*
4-
* $Id: mac.c,v 1.13 1999/07/17 20:17:57 momjian Exp $
4+
* $Id: mac.c,v 1.14 1999/12/16 01:30:49 momjian Exp $
55
*/
66

77

@@ -132,7 +132,7 @@ manufacturer manufacturers[] = {
132132
((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))
133133

134134
#define lobits(addr) \
135-
((unsigned long)((addr->c<<16)|(addr->e<<8)|(addr->f)))
135+
((unsigned long)((addr->d<<16)|(addr->e<<8)|(addr->f)))
136136

137137
/*
138138
* MAC address reader. Accepts several common notations.

0 commit comments

Comments
 (0)