From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert P. J. Day" Subject: confusing comment, explanation of @IFF_RUNNING in if.h Date: Sun, 26 Aug 2018 04:13:25 -0400 (EDT) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: Linux kernel netdev mailing list Return-path: Received: from cpanel4.indieserve.net ([199.212.143.9]:43914 "EHLO cpanel4.indieserve.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726258AbeHZL5m (ORCPT ); Sun, 26 Aug 2018 07:57:42 -0400 Received: from cpef81d0f814063-cmf81d0f814060.cpe.net.cable.rogers.com ([174.114.57.56]:54242 helo=localhost.localdomain) by cpanel4.indieserve.net with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1ftqD8-0075FI-ML for netdev@vger.kernel.org; Sun, 26 Aug 2018 04:15:51 -0400 Sender: netdev-owner@vger.kernel.org List-ID: 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 ========================================================================