[Toybox] Regarding ifconfig

Rob Landley rob at landley.net
Thu Feb 26 04:35:54 PST 2015


On 02/25/2015 04:15 AM, 김혜진 wrote:
> Hi.
> I have a question about ifconfig.
> Nov 30 on 2013, Rob deleted "trailers" and "dynamic" options because 
> they are dead fields unused by linux kernel.
>  
> But, "NOTRAILERS" and "DYNAMIC" string still exist in the code, line
> from 212 to 214 in ifconfig.c
> I think these also should be removed if really dead fields.

The "flags" field is set by a call to an ioctl, SIOCGIFFLAGS. The table
is the set of labels for the bit positions from /usr/include/linux/if.h:

/* Standard interface flags (netdevice->flags). */
#define IFF_UP          0x1             /* interface is up              */
#define IFF_BROADCAST   0x2             /* broadcast address valid      */
#define IFF_DEBUG       0x4             /* turn on debugging            */
#define IFF_LOOPBACK    0x8             /* is a loopback net            */
#define IFF_POINTOPOINT 0x10            /* interface is has p-p link    */
#define IFF_NOTRAILERS  0x20            /* avoid use of trailers        */
#define IFF_RUNNING     0x40            /* interface RFC2863 OPER_UP    */
#define IFF_NOARP       0x80            /* no ARP protocol              */
#define IFF_PROMISC     0x100           /* receive all packets          */
#define IFF_ALLMULTI    0x200           /* receive all multicast packets*/

#define IFF_MASTER      0x400           /* master of a load balancer    */
#define IFF_SLAVE       0x800           /* slave of a load balancer     */

#define IFF_MULTICAST   0x1000          /* Supports multicast           */

#define IFF_PORTSEL     0x2000          /* can set media type           */
#define IFF_AUTOMEDIA   0x4000          /* auto media select active     */
#define IFF_DYNAMIC     0x8000          /* dialup device with changing addresses*/

Even though a modern kernel should never set the NOTRAILERS or DYNAMIC
bits, those are the labels for those bit positions. (I could replace
each with "" but the space savings is trivial. We need something there
in each slot to get the spacing right.)

Rob

 1424954154.0


More information about the Toybox mailing list