From: Stephen Hemminger <shemminger@vyatta.com>
To: Arvid Brodin <Arvid.Brodin@xdin.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Javier Boticario <jboticario@gmail.com>,
Bruno Ferreira <balferreira@googlemail.com>
Subject: Re: HSR: How to set IF_OPER_LOWERLAYERDOWN?
Date: Tue, 26 Jun 2012 15:33:24 -0700 [thread overview]
Message-ID: <20120626153324.455c6081@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <4FEA37A0.309@xdin.com>
On Tue, 26 Jun 2012 22:28:51 +0000
Arvid Brodin <Arvid.Brodin@xdin.com> wrote:
> Hi,
>
> According to Documentation/networking/operstates.txt a network interface have an
> operational state and an administrative state.
>
> If I understand things correctly the administrative state is the desired state set by
> userspace, and the operational state is the actual state which depends on things like the
> administrative state, whether a carrier is present, or (for virtual interfaces lite VLAN)
> whether the lower interface is available.
>
>
> In the driver I'm writing (for the "HSR" redundancy protocol) a hsr (virtual) interface is
> useable as long as any of its (physical) slaves are useable. I.e. the operstate of a hsr
> device might be set like this:
>
> void hsr_set_operstate()
> {
> if (!is_admin_up(hsr_dev)) /* Check IFF_UP */ {
> set_operstate(hsr_dev, IF_OPER_DOWN);
> return;
> }
>
> if (is_operstate_up(slave1) || is_operstate_up(slave2)) /* Check IF_OPER_UP */
> set_operstate(hsr_dev, IF_OPER_UP);
> else
> set_operstate(hsr_dev, IF_OPER_LOWERLAYERDOWN);
> }
According to 802.1X example in documentation to set it down you need to set IF_OPER_DORMANT
not IF_OPER_LOWERLAYERDOWN. Probably a kernel bug in there somwhere.
next prev parent reply other threads:[~2012-06-26 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 22:28 HSR: How to set IF_OPER_LOWERLAYERDOWN? Arvid Brodin
2012-06-26 22:33 ` Stephen Hemminger [this message]
2012-06-27 1:42 ` Arvid Brodin
2012-06-27 15:40 ` Stephen Hemminger
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=20120626153324.455c6081@nehalam.linuxnetplumber.net \
--to=shemminger@vyatta.com \
--cc=Arvid.Brodin@xdin.com \
--cc=balferreira@googlemail.com \
--cc=jboticario@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