netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Friesen <chris.friesen@genband.com>
To: David Miller <davem@davemloft.net>
Cc: dev@nico22.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: Network link detection
Date: Thu, 03 Mar 2011 17:54:12 -0600	[thread overview]
Message-ID: <4D702A24.70805@genband.com> (raw)
In-Reply-To: <20110303.140106.191399853.davem@davemloft.net>

On 03/03/2011 04:01 PM, David Miller wrote:
> From: Chris Friesen <chris.friesen@genband.com>
> Date: Thu, 03 Mar 2011 15:38:35 -0600
> 
>> You might look at whether you could write a kernel module to register
>> for NETDEV_CHANGE notifications and pass that back to userspace.
> 
> This is the kind of responses you get when you ask networking specific
> questions and don't CC: netdev :-/

My apologies for misleading the original poster.  I can only claim a
brain fart since I've actually used rtnetlink for other things.

> There is this thing called netlink, you can listen for arbitrary
> network state change events on a socket, and get the link state
> notifications you are looking for.  It's in use by many real
> applications like NetworkManager and co.

For future reference then, to listen for link state notifications you'd
use NETLINK_ROUTE with nl_groups set to RTMGRP_LINK, and the link state
will be signaled in the if_flags field of received messages?

Chris

-- 
Chris Friesen
Software Developer
GENBAND
chris.friesen@genband.com
www.genband.com

      parent reply	other threads:[~2011-03-03 23:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20110303193006.GA29129@svh.nico22.de>
     [not found] ` <4D700A5B.2000807@genband.com>
2011-03-03 22:01   ` Network link detection David Miller
2011-03-03 22:29     ` Nico Schümann
2011-03-07 19:49       ` Dan Williams
2011-03-03 23:54     ` Chris Friesen [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=4D702A24.70805@genband.com \
    --to=chris.friesen@genband.com \
    --cc=davem@davemloft.net \
    --cc=dev@nico22.de \
    --cc=linux-kernel@vger.kernel.org \
    --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).