All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: Yasuyuki KOZAKAI <yasuyuki.kozakai@toshiba.co.jp>
Cc: rusty@rustcorp.com.au, netfilter-devel@lists.netfilter.org,
	pablo@netfilter.org, kadlec@blackhole.kfki.hu
Subject: Re: [PATCH 02/10] nf_conntrack: Introduces a extension infrastructure
Date: Mon, 25 Jun 2007 17:43:47 +0200	[thread overview]
Message-ID: <467FE2B3.9090403@trash.net> (raw)
In-Reply-To: <200706251535.l5PFZlux026579@toshiba.co.jp>

Yasuyuki KOZAKAI wrote:
> Hi, Patrick,
> 
> Thanks for your review. I'm impressed with your huge works in many areas.
> I've applied your suggestions, except following.
> 
> From: Patrick McHardy <kaber@trash.net>
> Date: Mon, 25 Jun 2007 12:01:02 +0200
> 
> 
>>>+void *__nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, int gfp)
>>
>>
>>Does any caller actually use something besides GFP_ATOMIC for gfp?
> 
> 
> nf_conntrack_netlink does that.


I missed that, thanks.

>>>+{
>>>+	struct nf_ct_ext *new;
>>>+	int i, newlen, newoff;
>>>+	struct nf_ct_ext_type *t;
>>>+
>>>+	if (!ct->ext)
>>>+		return nf_ct_ext_create(&ct->ext, id, gfp);
>>>+
>>>+	if (nf_ct_ext_exist(ct, id))
>>>+		return NULL;
>>>+
>>>+	rcu_read_lock();
>>>+	t = rcu_dereference(nf_ct_ext_types[id]);
>>>+	BUG_ON(t == NULL);
>>>+
>>>+	newoff = ALIGN(ct->ext->len, t->align);
>>>+	newlen = newoff + t->len;
>>>+	rcu_read_unlock();
>>>+
>>>+	if (newlen >= ct->ext->real_len) {
>>>+		new = kmalloc(newlen, gfp);
>>>+		if (!new)
>>>+			return NULL;
>>>+
>>>+		memcpy(new, ct->ext, ct->ext->len);
>>
>>And maybe krealloc here?
> 
> 
> krealloc() is possible to free old area before t->move().
> That breaks list used by NAT.


You're right, thanks.

  reply	other threads:[~2007-06-25 15:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-25  3:14 [PATCH 02/10] nf_conntrack: Introduces a extension infrastructure Yasuyuki KOZAKAI
2007-06-25 10:01 ` Patrick McHardy
2007-06-25 15:35   ` Yasuyuki KOZAKAI
2007-06-25 15:43     ` Patrick McHardy [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-25 17:21 Yasuyuki KOZAKAI
     [not found] <200706251721.l5PHLQ8x023174@toshiba.co.jp>
2007-06-25 18:16 ` 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=467FE2B3.9090403@trash.net \
    --to=kaber@trash.net \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=pablo@netfilter.org \
    --cc=rusty@rustcorp.com.au \
    --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.