Skip site navigation (1) Skip section navigation (2)

Mac address lobits macro error

From: Daniel Boyd <Daniel(dot)Boyd(at)vacationclub(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Mac address lobits macro error
Date: 1999-10-08 11:59:09
Message-ID: 199910081159.HAA05570@oberon.vacationclub.com (view raw or flat)
Thread:
Lists: pgsql-bugs
============================================================================
                        POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name		:	Daniel F. Boyd
Your email address	:	Daniel(dot)Boyd(at)vacationclub(dot)com


System Configuration
- ---------------------
  Architecture (example: Intel Pentium)  	:Intel Pentium

  Operating System (example: Linux 2.0.26 ELF) 	:FreeBSD 3.2

  PostgreSQL version (example: PostgreSQL-6.5)  :   PostgreSQL-6.5

  Compiler used (example:  gcc 2.8.0)		:gcc version 2.7.2.1


Please enter a FULL description of your problem:
- ------------------------------------------------
Ethernet MAC addresses (macaddr type) are not compared correctly for
equality.

Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible: 
- ----------------------------------------------------------------------
select '0000c0:d178d1'::macaddr = '0000c0:0b78d1'::macaddr;

Should return false, as these two mac addresses are different -- but
it returns true.


If you know how this problem might be fixed, list the solution below:
- ---------------------------------------------------------------------


Apply this patch to postgresql-6.5/src/backend/utils/adt/mac.c

*** mac.c_orig  Thu Oct  7 17:12:38 1999
--- mac.c       Thu Oct  7 17:12:52 1999
***************
*** 136,142 ****
    ((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.
--- 136,142 ----
    ((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.
------- end -------

pgsql-bugs by date

Next:From: Tom LaneDate: 1999-10-08 14:04:02
Subject: Re: [BUGS] 6.5.2 BUG: Rolling back after dropping a table causes dangling relationships.
Previous:From: Lincoln YeohDate: 1999-10-08 07:02:23
Subject: 6.5.2 BUG: Rolling back after dropping a table causes dangling relationships.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group