Re: [SCM] opendkim branch, bug-msk-sf3151405, ipv6

From: Murray S. Kucherawy <msk_at_blackops.org>
Date: Wed, 5 Jan 2011 22:32:21 -0800 (PST)

On Thu, 6 Jan 2011, Daniel Black wrote:
>> diff --git a/stats/mkdb.mysql b/stats/mkdb.mysql
>> index 8c2fd76..a30e269 100644
>> --- a/stats/mkdb.mysql
>> +++ b/stats/mkdb.mysql
>> @@ -41,7 +41,7 @@ create table if not exists messages (
>> jobid varchar(255) not null,
>> reporter int unsigned not null,
>> from_domain int unsigned not null,
>> - ipaddr varchar(255) not null,
>> + ip int unsigned not null,
>
> opendkim/stats.c seems to handle ipv6 but unsigned int isn't big enough.
>
> seems DECIMAL(39) is the only suitable mysql type though.
>
> http://oierud.name/bliki/IPv6AdressesAndMysql.html

Actually "ip" is now an index into another table, not an actual IP
address. The new table contains IP address in text form since MySQL
doesn't have an inet_ntoa() that handles IPv6. The new table's definition
is in stats/mkdb.mysql on the branch:

-- table of IP addresses we've seen
create table if not exists ipaddrs (
         id int unsigned not null auto_increment,
         addr varchar(255) not null,
         firstseen timestamp not null default CURRENT_TIMESTAMP,

         primary key(id),
         key(addr)
) engine=innodb default charset=latin1;

-MSK
Received on Mon Jan 10 2011 - 04:21:57 PST

This archive was generated by hypermail 2.2.0+W3C-0.50 : Mon Jan 10 2011 - 14:50:02 PST