From: Roman Hoog Antink <rha@open.ch>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: kaber@trash.net, Josef Drexler <joe-lk@ttdpatch.net>,
Netfilter Developer Mailing List
<netfilter-devel@vger.kernel.org>
Subject: Re: xt_recent compat code supposedly broken
Date: Fri, 24 Apr 2009 13:32:50 +0200 [thread overview]
Message-ID: <49F1A362.6020109@open.ch> (raw)
In-Reply-To: <alpine.LSU.2.00.0904241050030.22023@fbirervta.pbzchgretzou.qr>
[-- Attachment #1: Type: text/plain, Size: 189 bytes --]
Thank you!
Find attached the slightly adapted patch (nf_inet_addr is a union, not
struct). I tested it successfully with kernel 2.6.29 and it fixed the
compat path issue.
Cheers
Roman
[-- Attachment #2: xt_recent-compat-2.6.29.patch --]
[-- Type: text/x-patch, Size: 983 bytes --]
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 791e030..fcc2d7b 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -474,7 +474,7 @@ static ssize_t recent_old_proc_write(struct file *file,
struct recent_table *t = pde->data;
struct recent_entry *e;
char buf[sizeof("+255.255.255.255")], *c = buf;
- __be32 addr;
+ union nf_inet_addr addr = {};
int add;
if (size > sizeof(buf))
@@ -506,14 +506,13 @@ static ssize_t recent_old_proc_write(struct file *file,
add = 1;
break;
}
- addr = in_aton(c);
+ addr.ip = in_aton(c);
spin_lock_bh(&recent_lock);
- e = recent_entry_lookup(t, (const void *)&addr, NFPROTO_IPV4, 0);
+ e = recent_entry_lookup(t, &addr, NFPROTO_IPV4, 0);
if (e == NULL) {
if (add)
- recent_entry_init(t, (const void *)&addr,
- NFPROTO_IPV4, 0);
+ recent_entry_init(t, &addr, NFPROTO_IPV4, 0);
} else {
if (add)
recent_entry_update(t, e);
-- # Created with git-export-patch
next prev parent reply other threads:[~2009-04-24 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-24 8:43 Fwd: xt_recent compat code supposedly broken Jan Engelhardt
2009-04-24 8:54 ` Jan Engelhardt
2009-04-24 11:32 ` Roman Hoog Antink [this message]
2009-04-24 15:06 ` Patrick McHardy
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=49F1A362.6020109@open.ch \
--to=rha@open.ch \
--cc=jengelh@medozas.de \
--cc=joe-lk@ttdpatch.net \
--cc=kaber@trash.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.