netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: marty <martinbarrowcliff@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: Ulogd - mysql addresses are in network-byte order
Date: Sat, 31 Dec 2011 18:27:45 +0100	[thread overview]
Message-ID: <20111231172745.GA17716@1984> (raw)
In-Reply-To: <4EFF3A14.10705@gmail.com>

On Sat, Dec 31, 2011 at 11:36:36AM -0500, marty wrote:
> This is NOT a bug,  but I believe it needs consideration for change.
> So lets call it a feature request to stay friendly.
> 
> ulogd.c:733 assigning `ip.saddr(?)' as source for MYSQL(ip.saddr)
> ulogd.c:733 assigning `ip.daddr(?)' as source for MYSQL(ip.daddr)
> 
> On a little-endian architecture these values are incompatable with
> the native math functions and totally unsuitable for making
> comparisons in mysql.
> 
> eg:
> if (( ip.saddr > nnnnnnnnn ) AND ( ip.saddr < mmmmmmmm)) ...
> This simply will not work on a little endian machine.
> 
> It is impractical to do a byte order conversion using a bunch
> of the high level routines within mysql, and it may not be
> timely to do it later using a scripting language.
> 
> IMHO I believe it is appropriate for these values to be in
> host-byte order before they are ever assigned to mysql.
> This would then match the byte order of any machine.
> If there are compelling reasons to use network byte order,
> I suggest this be a configurable option, not the default.
> 
> Thanks for a great piece of software,

Thanks for the report.

Would you be brave enough to send me a patch to address this?

  reply	other threads:[~2011-12-31 17:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-31 16:36 Ulogd - mysql addresses are in network-byte order marty
2011-12-31 17:27 ` Pablo Neira Ayuso [this message]
2011-12-31 18:28   ` marty
2012-01-01 15:55     ` Pablo Neira Ayuso
  -- strict thread matches above, loose matches on Subject: below --
2012-01-02  5:03 marty
2012-01-02 18:08 ` Pablo Neira Ayuso
2012-01-02 20:02   ` marty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111231172745.GA17716@1984 \
    --to=pablo@netfilter.org \
    --cc=martinbarrowcliff@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).