netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: linus.luessing@c0d3.blue
Cc: bridge@lists.linux-foundation.org, herbert@gondor.apana.org.au,
	yoshfuji@linux-ipv6.org, netdev@vger.kernel.org,
	b.a.t.m.a.n@lists.open-mesh.org, linux-kernel@vger.kernel.org,
	therbert@google.com
Subject: Re: [PATCHv2 net-next 2/2] net: Export IGMP/MLD message validation code
Date: Tue, 14 Apr 2015 14:27:07 -0400 (EDT)	[thread overview]
Message-ID: <20150414.142707.472821254273583286.davem@davemloft.net> (raw)
In-Reply-To: <1428993462-6079-3-git-send-email-linus.luessing@c0d3.blue>

From: Linus Lüssing <linus.luessing@c0d3.blue>
Date: Tue, 14 Apr 2015 08:37:42 +0200

> +int skb_checksum_trimmed(struct sk_buff *skb, unsigned int transport_len,
> +			 __sum16(*skb_check_func)(struct sk_buff *skb),
> +			 struct sk_buff **skb_trimmed)
> +{

This is a really terrible interface.

It is designed in such a way that it is completely ambiguous who is
resonsible for managing the lifetimes of 'skb' and 'skb_trimmed'.

I would suggest changing this such that:

1) If you clone successfully, 'skb' is released.

2) whatever SKB ends up being used is returned as an error pointer.

3) The caller is responsible for freeing or grabbing a reference
   to the skb returned.

Also, this is taking too long to finalize and we are past the openning
of the merge window so you will have to submit a fixed up version when
the net-next tree opens up for submissions as it is very strongly
closed right now.

Thanks.

      reply	other threads:[~2015-04-14 18:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14  6:37 [PATCHv2 net-next 0/2] Exporting IGMP/MLD checking from bridge code Linus Lüssing
2015-04-14  6:37 ` [PATCHv2 net-next 1/2] bridge: multicast: call skb_checksum_{simple_, }validate Linus Lüssing
2015-04-14  6:37 ` [PATCHv2 net-next 2/2] net: Export IGMP/MLD message validation code Linus Lüssing
2015-04-14 18:27   ` David Miller [this message]

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=20150414.142707.472821254273583286.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=linus.luessing@c0d3.blue \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=therbert@google.com \
    --cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).