Thread: Allow format 0000-0000-0000 in postgresql MAC parser

Allow format 0000-0000-0000 in postgresql MAC parser

From
Herwin Weststrate
Date:
Hello,

Some devices send the MAC address in RADIUS requests in the format
0000-0000-0000. I've seen this with a 3com switch, but there may be
others. Currently, postgresql doesn't understand this format.

This patch adds an extra line to the macaddr parsing in postgres to
support this format as well. A unit test has been added.

Kind regards,

--
Herwin Weststrate
Quarantainenet BV
www.quarantainenet.nl

Attachment

Re: Allow format 0000-0000-0000 in postgresql MAC parser

From
Michael Paquier
Date:
On Mon, Sep 29, 2014 at 6:30 PM, Herwin Weststrate
<herwin@quarantainenet.nl> wrote:
> Some devices send the MAC address in RADIUS requests in the format
> 0000-0000-0000. I've seen this with a 3com switch, but there may be
> others. Currently, postgresql doesn't understand this format.
>
> This patch adds an extra line to the macaddr parsing in postgres to
> support this format as well. A unit test has been added.
You should register this patch in the next commit fest where it will
be fully reviewed and hopefully committed for 9.5:
https://commitfest.postgresql.org/action/commitfest_view?id=24

Looking at your patch, you should update the documentation as well,
the list of authorized outputs being clearly listed:
http://www.postgresql.org/docs/devel/static/datatype-net-types.html#DATATYPE-MACADDR
This consists in adding simply one line to doc/src/sgml/datatype.sgml.
Regards,
-- 
Michael



Re: Allow format 0000-0000-0000 in postgresql MAC parser

From
Herwin Weststrate
Date:
On 01-10-14 01:19, Michael Paquier wrote:
> Looking at your patch, you should update the documentation as well,
> the list of authorized outputs being clearly listed:
> http://www.postgresql.org/docs/devel/static/datatype-net-types.html#DATATYPE-MACADDR
> This consists in adding simply one line to doc/src/sgml/datatype.sgml.
> Regards,

It has been registered now
(https://commitfest.postgresql.org/action/patch_view?id=1585). I've got
an updated version of the patch with the documentation fix.

--
Herwin Weststrate
Quarantainenet BV

Attachment

Re: Allow format 0000-0000-0000 in postgresql MAC parser

From
Ali Akbar
Date:

It has been registered now
(https://commitfest.postgresql.org/action/patch_view?id=1585). I've got
an updated version of the patch with the documentation fix.
 
Looks like the patch is all good. I'm marking as ready for commiter.

On a side note, i'm noticing from http://en.wikipedia.org/wiki/MAC_address, that there is three numbering namespace for MAC: MAC-48, EUI-48 and EUI-64. The last one is 64 bits long (8 bytes). Currently PostgreSQL's macaddr is only 6 bytes long. Should we change it to 8 bytes (not in this patch, of course)?

Regards,
--
Ali Akbar

Re: Allow format 0000-0000-0000 in postgresql MAC parser

From
Peter Eisentraut
Date:
On 10/1/14 8:34 AM, Herwin Weststrate wrote:
> It has been registered now
> (https://commitfest.postgresql.org/action/patch_view?id=1585). I've got
> an updated version of the patch with the documentation fix.

committed



Re: Allow format 0000-0000-0000 in postgresql MAC parser

From
Peter Eisentraut
Date:
On 10/17/14 6:37 PM, Ali Akbar wrote:
> On a side note, i'm noticing from
> http://en.wikipedia.org/wiki/MAC_address, that there is three numbering
> namespace for MAC: MAC-48, EUI-48 and EUI-64. The last one is 64 bits
> long (8 bytes). Currently PostgreSQL's macaddr is only 6 bytes long.
> Should we change it to 8 bytes (not in this patch, of course)?

It looks like nothing current is actually using EUI-64, so probably not,
unless someone comes with an actual use case.