linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Andre Naujoks <nautsch2@gmail.com>,
	"linux-can@vger.kernel.org" <linux-can@vger.kernel.org>
Subject: Re: [PATCH stable 3.11+] can: use private sk reference to detect originating socket
Date: Wed, 29 Jan 2014 21:40:58 +0100	[thread overview]
Message-ID: <52E9675A.4070201@hartkopp.net> (raw)
In-Reply-To: <1391025348.28432.63.camel@edumazet-glaptop2.roam.corp.google.com>

On 29.01.2014 20:55, Eric Dumazet wrote:

>> 2. The check for sk and the additional skb_orphan() is not needed as the
>> can_skb_set_owner() is invoked only after 'fresh' skb allocation or after
>> clone/skb_orphan() - so we know the skb state very good.
> 
> Yep, but then you added skb_orphan() calls. when skb is not shared.

I did that e.g. in the sources placed in driver/net/can because I assume that
I can not be sure that I always get skbs created by AF_CAN.

E.g. one could also use AF_PACKET to send CAN frames to the CAN interfaces.

Btw. assuming AF_PACKET does it correct too with the destructor I will omit
the skb_orphan() / can_skb_set_owner() sequence in drivers/net/can in the next
attempt.

Tnx
Oliver

> 
> I think you really should have a helper instead of copying this 3 times.
> 

ok


  reply	other threads:[~2014-01-29 20:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52E905C8.1060408@hartkopp.net>
2014-01-29 14:38 ` [PATCH stable 3.11+] can: use private sk reference to detect originating socket Marc Kleine-Budde
     [not found] ` <1391007745.28432.36.camel@edumazet-glaptop2.roam.corp.google.com>
     [not found]   ` <1391009406.28432.38.camel@edumazet-glaptop2.roam.corp.google.com>
     [not found]     ` <1391010437.28432.39.camel@edumazet-glaptop2.roam.corp.google.com>
2014-01-29 19:30       ` Oliver Hartkopp
2014-01-29 19:55         ` Eric Dumazet
2014-01-29 20:40           ` Oliver Hartkopp [this message]
2014-01-29 21:00             ` Oliver Hartkopp
2014-01-29 21:06               ` Eric Dumazet
2014-01-29 21:25                 ` Oliver Hartkopp
2014-01-30  8:32               ` Andre Naujoks

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=52E9675A.4070201@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=nautsch2@gmail.com \
    --cc=netdev@vger.kernel.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).