All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel <netfilter-devel@lists.netfilter.org>
Subject: Re: [PATCH] SANE conntrack helper
Date: Mon, 27 Nov 2006 20:31:48 +0100	[thread overview]
Message-ID: <456B3D24.9020405@stud.feec.vutbr.cz> (raw)
In-Reply-To: <456B354F.5040101@trash.net>

Patrick McHardy skrev:
> Michal Schmidt wrote:
>> Attached is nf_conntrack_sane, a netfilter connection tracking helper
>> module for the SANE protocol used by the 'saned' daemon to make scanners
>> available via network.
> Looks quite sane :) We have a large number of nf_conntrack patches
> queued up already, some of which change or enhance the API,
> so please port your helper on top of the nf_nat tree (check out
> the mailing list archives of the past two weeks for details
> how to clone it).
> 
> A few more comments below ..

Thank you for your suggestions. I'll check out the nf_nat tree and do 
the fixes you recommend.

>> +	/* It's a reply to SANE_NET_START */
>> +	if (datalen < 8) {
>> +		if (net_ratelimit())
>> +			printk(KERN_NOTICE "conntrack_sane: reply "
>> +			       "too short (%u bytes)\n", datalen);
> 
> Same here, please no ringbuffer spamming.
> 
>> +		ret = NF_DROP;
> 
> Dropping is quite unfriendly too. You should only do it if it is
> necessary for accurate tracking, f.e. in the FTP newline case.

Yes, I'm aware of that. This assumption that the reply packet will 
always contain at least 8 data packets makes the implementation easier 
(and in practice, 'saned' always does that). I'll have to think a bit 
about how to do it without depending on this.

>> +	sane_port = ntohl(*(u32 *)(sb_ptr+4));
>> +	if (sane_port > 0xffff)	{
> 
> 32 bit port numbers? :)

That's right. In the SANE protocol, the port number is encoded into a 
"SANE_Word" type, which is surprisingly 32-bit.

Thanks,
Michal

  reply	other threads:[~2006-11-27 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-26 20:09 [PATCH] SANE conntrack helper Michal Schmidt
2006-11-27 18:58 ` Patrick McHardy
2006-11-27 19:31   ` Michal Schmidt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-12-04 21:52 Michal Schmidt

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=456B3D24.9020405@stud.feec.vutbr.cz \
    --to=xschmi00@stud.feec.vutbr.cz \
    --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.