netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* confusing comment, explanation of @IFF_RUNNING in if.h
@ 2018-08-26  8:13 Robert P. J. Day
  2018-08-26 19:20 ` Andrew Lunn
  0 siblings, 1 reply; 9+ messages in thread
From: Robert P. J. Day @ 2018-08-26  8:13 UTC (permalink / raw)
  To: Linux kernel netdev mailing list


  more annoying pedantry ... from include/uapi/linux/if.h:

    * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile.

however, both the code in net/core/dev.c:

/**
 *      netif_oper_up - test if device is operational
 *      @dev: network device
 *
 * Check if carrier is operational
 */
static inline bool netif_oper_up(const struct net_device *dev)
{
        return (dev->operstate == IF_OPER_UP ||
                dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
}

and the explanation in operstates.txt:

  ifinfomsg::if_flags & IFF_RUNNING:
    Interface is in RFC2863 operational state UP or UNKNOWN.

suggests IFF_RUNNING represents *either* of the operational states UP
or UNKNOWN, not just UP as the comment in if.h claims. is this
misleading? or is this a deliberate explanation somehow taking into
account that the UNKNOWN state is for backward compatibility (whatever
that means)?

  i ask since, in my testing, when the interface should have been up,
the attribute file "operstate" for that interface showed "unknown",
and i wondered how worried i should be about that.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-08-27 11:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-26  8:13 confusing comment, explanation of @IFF_RUNNING in if.h Robert P. J. Day
2018-08-26 19:20 ` Andrew Lunn
2018-08-26 19:20   ` Robert P. J. Day
2018-08-26 19:28     ` Andrew Lunn
2018-08-26 19:30       ` Robert P. J. Day
2018-08-26 20:51     ` Stephen Hemminger
2018-08-27  6:20       ` Robert P. J. Day
2018-08-27  7:11         ` Oliver Hartkopp
2018-08-27  8:04           ` Robert P. J. Day

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).