From: Ben Greear <greearb@candelatech.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: tgraf@suug.ch, netdev@oss.sgi.com
Subject: Re: af_packet.c bug?
Date: Mon, 28 Mar 2005 12:30:25 -0800 [thread overview]
Message-ID: <42486961.9060609@candelatech.com> (raw)
In-Reply-To: <20050328121806.3208ac40.davem@davemloft.net>
David S. Miller wrote:
> On Mon, 28 Mar 2005 12:08:14 -0800
> Ben Greear <greearb@candelatech.com> wrote:
>
>
>>I was also wondering why we couldn't hold a reference to the net-device
>>instead of just it's ifindex when dealing with a bound raw socket.
>
>
> Because then raw sockets could make unloading of netdevices
> hang forever. That is, unless you add some netdev notifier
> to af_packet.c that walks all the raw sockets looking for netdev
> references.
> I guess it also would make things like leaving a dump running
> while you quickly down/up and interface stop working.
>
I was thinking of removing the reference only when the NETDEV_UNREGISTER
event was sent. That will allow sockets to work through UP and DOWN transitions
of the device as it does currently.
We could also save the name of the interface in the socket struct and resolve
the device in a lazy manner. That way, even if the device is truly gone, the
worst case performance will be like it is today.
It would be nice to have a list of all of these sockets so we could get info
on them similar to the 'netstat -an' output anyway...
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2005-03-28 20:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-28 19:19 af_packet.c bug? Ben Greear
2005-03-28 19:55 ` Thomas Graf
2005-03-28 20:08 ` Ben Greear
2005-03-28 20:17 ` Thomas Graf
2005-03-28 20:33 ` Ben Greear
2005-03-28 20:18 ` David S. Miller
2005-03-28 20:30 ` Ben Greear [this message]
2005-03-28 20:33 ` David S. Miller
2005-04-01 4:59 ` David S. Miller
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=42486961.9060609@candelatech.com \
--to=greearb@candelatech.com \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
--cc=tgraf@suug.ch \
/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).