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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy