Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: laurent vaudoit <laurent.vaudoit@gmail.com>
Cc: linux-can@vger.kernel.org
Subject: Re: Raw can socket close and disabling filters
Date: Mon, 25 Apr 2016 09:54:52 +0200	[thread overview]
Message-ID: <571DCD4C.50601@hartkopp.net> (raw)
In-Reply-To: <CAA7hF3wiPi7ybKnpCcFGkQfED-gsZcn_Wahz2u+8Q01Z8-DN8Q@mail.gmail.com>

On 04/25/2016 09:19 AM, laurent vaudoit wrote:

>> So when the notifier runs with NETDEV_UNREGISTER it will remove the filters
>> & bind status.
>>
>> In this case the block in raw_release() won't have anything to do to release
>> the filters and the bind state, right?
>
> i agree with this. The fact is that on my setup i need to send an
> information to another µc when releasing a socket on a device, and so
> my specific code was done in the release function, after the
> unregister.

I think using raw_release() as trigger is always a good choice.

> This is how i've seen this behaviour.

Interesting information. I didn't know about the notifier running at 
unregister_netdevice_notifier() time.

>> Looks double work - but I wonder why we can rely on a notifier call when we
>> call unregister_netdevice_notifier() ??
>
> For me, the disable_all_filter part of code in release can not be
> called, as the ro->bound will allways be 0.

The question remains whether we can really rely on the notifier call 
which is obviously invoked by unregister_netdevice_notifier() ...
I'll have to dig if this behaviour is intentional and documented.
Until then I feel better to leave it as-is.

Regards,
Oliver

  reply	other threads:[~2016-04-25  7:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-22 11:39 Raw can socket close and disabling filters laurent vaudoit
2016-04-23 13:33 ` Oliver Hartkopp
2016-04-25  7:19   ` laurent vaudoit
2016-04-25  7:54     ` Oliver Hartkopp [this message]
2016-04-25  7:57       ` laurent vaudoit

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=571DCD4C.50601@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=laurent.vaudoit@gmail.com \
    --cc=linux-can@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