Allow format 0000-0000-0000 in postgresql MAC parser

Lists: pgsql-hackers
From: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-09-29 09:30:35
Message-ID: 542926BB.4010402@quarantainenet.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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 Content-Type Size
postgres-mac-parsing.diff text/x-patch 4.8 KB

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-09-30 23:19:04
Message-ID: CAB7nPqRbDZHy9CpN_mepSt1gP9gW66R-j7tvR6Bvx6bRvZpvXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, Sep 29, 2014 at 6:30 PM, Herwin Weststrate
<herwin(at)quarantainenet(dot)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


From: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-10-01 12:34:50
Message-ID: 542BF4EA.8050006@quarantainenet.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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 Content-Type Size
postgres-mac-parsing.diff text/x-patch 5.6 KB

From: Ali Akbar <the(dot)apaan(at)gmail(dot)com>
To: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-10-17 22:37:58
Message-ID: CACQjQLpnEZcjsf=Yf55k=ASn7r78H+UTYBf1soQ0XMhGRL1WLg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> 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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Herwin Weststrate <herwin(at)quarantainenet(dot)nl>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-10-21 20:21:00
Message-ID: 5446C02C.6060301@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Ali Akbar <the(dot)apaan(at)gmail(dot)com>, Herwin Weststrate <herwin(at)quarantainenet(dot)nl>
Cc: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow format 0000-0000-0000 in postgresql MAC parser
Date: 2014-10-21 20:21:42
Message-ID: 5446C056.50103@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.