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: Mon, 2 Jan 2012 19:08:11 +0100 [thread overview]
Message-ID: <20120102180811.GA26533@1984> (raw)
In-Reply-To: <4F013AB2.8030004@gmail.com>
On Mon, Jan 02, 2012 at 12:03:46AM -0500, marty wrote:
>
> Here, for your review is a patch to
> address the issue that I reported.
>
> --- orig.ulogd_raw2packet_BASE.c 2011-12-08 11:55:09.000000000 -0500
> +++ ulogd_raw2packet_BASE.c 2012-01-01 23:40:14.000000000 -0500
> @@ -717,8 +717,8 @@
> return ULOGD_IRET_OK;
> len -= iph->ihl * 4;
>
> - okey_set_u32(&ret[KEY_IP_SADDR], iph->saddr);
> - okey_set_u32(&ret[KEY_IP_DADDR], iph->daddr);
> + okey_set_u32(&ret[KEY_IP_SADDR], ntohl(iph->saddr));
> + okey_set_u32(&ret[KEY_IP_DADDR], ntohl(iph->daddr));
> okey_set_u8(&ret[KEY_IP_PROTOCOL], iph->protocol);
> okey_set_u8(&ret[KEY_IP_TOS], iph->tos);
> okey_set_u8(&ret[KEY_IP_TTL], iph->ttl);
Many other plugins rely on the address in network byte order.
Can you fix this in the mysql plugin by adding some configurable
option?
more suggestions for your next patches, please:
* include short description before the patch.
* they have to apply with patch -p1 < file.patch
you can generate this with git diff HEAD (there are more advanced ways
to do this in git though).
thanks.
next prev parent reply other threads:[~2012-01-02 18:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-02 5:03 Ulogd - mysql addresses are in network-byte order marty
2012-01-02 18:08 ` Pablo Neira Ayuso [this message]
2012-01-02 20:02 ` marty
-- strict thread matches above, loose matches on Subject: below --
2011-12-31 16:36 marty
2011-12-31 17:27 ` Pablo Neira Ayuso
2011-12-31 18:28 ` marty
2012-01-01 15:55 ` Pablo Neira Ayuso
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=20120102180811.GA26533@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).