lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 3 Mar 2011 21:45:35 +0100
From:	richard -rw- weinberger <richard.weinberger@...il.com>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	Nico Schümann <dev@...o22.de>,
	linux-kernel@...r.kernel.org
Subject: Re: Network link detection

On Thu, Mar 3, 2011 at 9:03 PM, Jesper Juhl <jj@...osbits.net> wrote:
> On Thu, 3 Mar 2011, Nico Schümann wrote:
>
>> Dear kernel developers,
>>
>> currently I'm looking for a way to find out whether a network link went
>> down or up. Of course there is mii-tool, which can watch devices, too.
>>
>> So for now, I created a small program that polls the MII_LINK_OK
>> flag with the SIOCGMIIREG ioctl - the same thing that mii-tools does.
>> But polling that often for a link change that occurs maybe once in a
>> month sounds like waste of energy.
>>
>> Unfortunately, I was not able to find out a way to be notified about
>> link status changes asynchronously. Is there a way? I'm looking for
>> something like "inotify for link states".
>>
> I guess you could use inotify to keep an eye on the 'carrier' file in
> sysfs (for example, from my system;
> /sys/devices/pci0000:00/0000:00:19.0/net/eth0/carrier )
> That file will contain "0" if there is no link and "1" if there is a link.

Does sysfs support inotify?
I don't think so.

> --
> Jesper Juhl <jj@...osbits.net>            http://www.chaosbits.net/
> Plain text mails only, please.
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
>

-- 
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ