All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Kellermann <max@duempel.org>
To: netfilter-devel@lists.netfilter.org
Cc: Patrick McHardy <kaber@trash.net>
Subject: [PATCH] ipt_TARPIT for Linux 2.6.21
Date: Fri, 27 Apr 2007 10:23:43 +0200	[thread overview]
Message-ID: <20070427082343.GA26645@roonstrasse.net> (raw)

Adapt ipt_TARPIT for Linux 2.6.21.

Signed-off-by: Max Kellermann <max@duempel.org>

diff --git a/net/ipv4/netfilter/ipt_TARPIT.c b/net/ipv4/netfilter/ipt_TARPIT.c
index 3a2bd64..f0e252d 100644
--- a/net/ipv4/netfilter/ipt_TARPIT.c
+++ b/net/ipv4/netfilter/ipt_TARPIT.c
@@ -100,7 +100,7 @@ static void tarpit_tcp(struct sk_buff *oskb,struct rtable *ort,int local)
 		return;
 
 	/* Check checksum. */
-	if (tcp_v4_check(otcph, otcplen, oskb->nh.iph->saddr,
+	if (tcp_v4_check(otcplen, oskb->nh.iph->saddr,
 			 oskb->nh.iph->daddr,
 			 csum_partial((char *)otcph, otcplen, 0)) != 0)
 		return;
@@ -158,7 +158,7 @@ static void tarpit_tcp(struct sk_buff *oskb,struct rtable *ort,int local)
 
 	/* Adjust TCP checksum */
 	ntcph->check = 0;
-	ntcph->check = tcp_v4_check(ntcph, sizeof(struct tcphdr),
+	ntcph->check = tcp_v4_check(sizeof(struct tcphdr),
 				   nskb->nh.iph->saddr,
 				   nskb->nh.iph->daddr,
 				   csum_partial((char *)ntcph,
@@ -269,8 +269,9 @@ static int check(const char *tablename,
 	return 1;
 }
 
-static struct ipt_target ipt_tarpit_reg = {
+static struct xt_target ipt_tarpit_reg = {
 	.name = "TARPIT",
+	.family = AF_INET,
 	.target = tarpit,
 	.checkentry = check,
 	.me = THIS_MODULE
@@ -278,12 +279,12 @@ static struct ipt_target ipt_tarpit_reg = {
 
 static int __init init(void)
 {
-	return ipt_register_target(&ipt_tarpit_reg);
+	return xt_register_target(&ipt_tarpit_reg);
 }
 
 static void __exit fini(void)
 {
-	ipt_unregister_target(&ipt_tarpit_reg);
+	xt_unregister_target(&ipt_tarpit_reg);
 }
 
 module_init(init);

             reply	other threads:[~2007-04-27  8:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-27  8:23 Max Kellermann [this message]
2007-04-27  8:31 ` [PATCH] ipt_TARPIT for Linux 2.6.21 Jan Engelhardt
2007-04-27  8:48   ` Max Kellermann
2007-04-27 11:05   ` Patrick McHardy
2007-04-27 11:04 ` 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=20070427082343.GA26645@roonstrasse.net \
    --to=max@duempel.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@lists.netfilter.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.