From: | Daniel Boyd <Daniel(dot)Boyd(at)vacationclub(dot)com> |
---|---|
To: | pgsql-patches(at)postgreSQL(dot)org |
Subject: | [PATCHES] Ethernet MAC bug. |
Date: | 1999-12-15 19:26:54 |
Message-ID: | 199912151926.OAA01699@oberon.vacationclub.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
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)
The mac addresses are different, but compare identical. This is still
broken even in -current.
Here's the (admittedly simple) fix:
*** ./src/backend/utils/adt/mac.c.orig Wed Dec 15 14:18:08 1999
--- ./src/backend/utils/adt/mac.c Wed Dec 15 14:18:20 1999
***************
*** 132,138 ****
((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))
#define lobits(addr) \
! ((unsigned long)((addr->c<<16)|(addr->e<<8)|(addr->f)))
/*
* MAC address reader. Accepts several common notations.
--- 132,138 ----
((unsigned long)((addr->a<<16)|(addr->b<<8)|(addr->c)))
#define lobits(addr) \
! ((unsigned long)((addr->d<<16)|(addr->e<<8)|(addr->f)))
/*
* MAC address reader. Accepts several common notations.
************
--ELM945307750-8421-0_
--ELM945307750-8421-0_--
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 1999-12-16 01:29:10 | Re: [BUGS] uniqueness not always correct |
Previous Message | Bruce Momjian | 1999-12-15 13:39:57 | Re: [BUGS] ECPG memory leak detected |