All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Netfilter Developer Mailing List
	<netfilter-devel@lists.netfilter.org>,
	Sami Farin <safari-netfilter@safari.iki.fi>,
	Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>,
	Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Subject: Re: xt_TARPIT
Date: Mon, 30 Jul 2007 14:23:40 +0200	[thread overview]
Message-ID: <46ADD84C.2070202@trash.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0707291608550.9488@fbirervta.pbzchgretzou.qr>

Jan Engelhardt wrote:
> 
> On Jul 18 2007 15:04, Patrick McHardy wrote:
> 
>>Jan Engelhardt wrote:
>>
>>>+EXPORT_SYMBOL(secure_tcp_sequence_number);
>>
>>Seems unnecessary, we don't really care whether the sequence number is
>>secure or not.
> 
> 
> Will tcp->seq = 0 do?


I don't know.

>>>+	/* Truncate to length (no data) */
>>>+	ntcph->doff = sizeof(struct tcphdr)/4;
>>>+	skb_trim(nskb, ip_hdrlen(nskb) + sizeof(struct tcphdr));
>>>+	niph->tot_len = htons(nskb->len);
>>>+
>>>+	/* Swap source and dest */
>>>+	niph->daddr = xchg(&niph->saddr, niph->daddr);
> 
> 
> BTW, how come ipt_REJECT does not use xchg()?


Because its not necessary, as in this case.

>>>+static bool xt_tarpit_check(const char *tablename, const void *entry,
>>>+                            const struct xt_target *target, void *targinfo,
>>>+                            unsigned int hook_mask)
>>>+{
>>>+	bool invalid;
>>>+
>>>+	if (strcmp(tablename, "raw") == 0 && hook_mask == NF_IP_PRE_ROUTING)
>>>+		return true;
>>>+	if (strcmp(tablename, "filter") != 0)
>>>+		return false;
>>>+	invalid = hook_mask & ~((1 << NF_IP_LOCAL_IN) | (1 << NF_IP_FORWARD));
>>
>>Use generic validation please. This logic also looks overly complicated.
> 
> 
> I suppose you mean
> 
> 	.table = "filter"
> 
> with "generic validation". I cannot use that, because it can be used in
> two tables. [ See below ]


The origin version was simply restricted to some hooks. Why
does the table matter?

>>>I don't really like adding a notrack reference in the TARPIT target
>>>though, I would prefer to use the one from the original packet (as in
>>>REJECT) and for NOTRACK you would simply mark the original packet.
>>
>>You're right. Yes, nf_ct_attach is also necessary. I need caffeine.
> 
> 
> So what's the final verdict? If TARPIT shall not imply NOTRACK,
> then of course I will remove the checks for "raw", etc. Please vote.


I think I already did :)

  reply	other threads:[~2007-07-30 12:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08 14:59 xt_TARPIT (was: ipt_account / iptables 1.3.8) Jan Engelhardt
2007-07-09 13:37 ` Patrick McHardy
2007-07-09 14:11   ` Jan Engelhardt
2007-07-09 14:15     ` Patrick McHardy
2007-07-09 14:58       ` Jan Engelhardt
2007-07-09 15:04         ` Patrick McHardy
2007-07-09 15:09           ` Jan Engelhardt
2007-07-09 15:16             ` Patrick McHardy
2007-07-10  9:17               ` Jan Engelhardt
     [not found] ` <20070710190717.ccq5x5v4s5pqvxto@m.safari.iki.fi>
2007-07-18 11:12   ` Jan Engelhardt
2007-07-18 13:04     ` Patrick McHardy
2007-07-18 15:02       ` Jozsef Kadlecsik
2007-07-19  0:38         ` xt_TARPIT Yasuyuki KOZAKAI
2007-07-19  0:44           ` xt_TARPIT Patrick McHardy
2007-07-19  1:09             ` xt_TARPIT Yasuyuki KOZAKAI
2007-07-19  6:49             ` xt_TARPIT Jozsef Kadlecsik
2007-07-29 14:44               ` xt_TARPIT Jan Engelhardt
2007-07-30 12:23                 ` Patrick McHardy [this message]
2007-07-30 13:35                   ` xt_TARPIT Jan Engelhardt

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=46ADD84C.2070202@trash.net \
    --to=kaber@trash.net \
    --cc=jengelh@computergmbh.de \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=safari-netfilter@safari.iki.fi \
    --cc=yasuyuki.kozakai@toshiba.co.jp \
    /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.