]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[settings] Eliminate settings "tag magic"
authorMichael Brown <mcb30@ipxe.org>
Wed, 1 May 2013 16:20:39 +0000 (17:20 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 1 May 2013 18:52:12 +0000 (19:52 +0100)
Create an explicit concept of "settings scope" and eliminate the magic
values used for numerical setting tags.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/interface/vmware/guestinfo.c
src/core/nvo.c
src/core/settings.c
src/drivers/net/phantom/phantom.c
src/include/ipxe/net80211.h
src/include/ipxe/netdevice.h
src/include/ipxe/settings.h
src/interface/smbios/smbios_settings.c
src/net/80211/net80211.c
src/net/dhcppkt.c
src/net/netdev_settings.c

index 5e08d9471152dfc6760556e31c9d026a473d891c..da013ca28f2bc249d57970c6f1105641f69f6611 100644 (file)
@@ -224,7 +224,7 @@ static int guestinfo_net_probe ( struct net_device *netdev ) {
                rc = -ENOMEM;
                goto err_alloc;
        }
-       settings_init ( settings, &guestinfo_settings_operations, NULL, 0 );
+       settings_init ( settings, &guestinfo_settings_operations, NULL, NULL );
 
        /* Register settings */
        if ( ( rc = register_settings ( settings, netdev_settings ( netdev ),
index 5383fe5c3681a052fef0538ecc30f14f28a5a09d..4c871b2fda2c033391e85a52b13c3160653bad2e 100644 (file)
@@ -195,7 +195,8 @@ static int nvo_save ( struct nvo_block *nvo ) {
 int nvo_applies ( struct settings *settings __unused,
                  struct setting *setting ) {
 
-       return dhcpopt_applies ( setting->tag );
+       return ( ( setting->scope == NULL ) &&
+                dhcpopt_applies ( setting->tag ) );
 }
 
 /**
@@ -274,7 +275,8 @@ void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
        nvo->len = len;
        nvo->resize = resize;
        dhcpopt_init ( &nvo->dhcpopts, NULL, 0, nvo_realloc_dhcpopt );
-       settings_init ( &nvo->settings, &nvo_settings_operations, refcnt, 0 );
+       settings_init ( &nvo->settings, &nvo_settings_operations,
+                       refcnt, NULL );
 }
 
 /**
index 43715fbd307badcb94d5032abb1b9ae8cf5ca1cd..54d48d326fecafaff90c56168b09721633eaed74 100644 (file)
@@ -984,7 +984,7 @@ void clear_settings ( struct settings *settings ) {
 int setting_cmp ( struct setting *a, struct setting *b ) {
 
        /* If the settings have tags, compare them */
-       if ( a->tag && ( a->tag == b->tag ) )
+       if ( a->tag && ( a->tag == b->tag ) && ( a->scope == b->scope ) )
                return 0;
 
        /* Otherwise, if the settings have names, compare them */
@@ -1099,19 +1099,17 @@ struct setting * find_setting ( const char *name ) {
 /**
  * Parse setting name as tag number
  *
- * @v settings         Settings block
  * @v name             Name
  * @ret tag            Tag number, or 0 if not a valid number
  */
-static unsigned int parse_setting_tag ( struct settings *settings,
-                                       const char *name ) {
+static unsigned int parse_setting_tag ( const char *name ) {
        char *tmp = ( ( char * ) name );
        unsigned int tag = 0;
 
        while ( 1 ) {
                tag = ( ( tag << 8 ) | strtoul ( tmp, &tmp, 0 ) );
                if ( *tmp == 0 )
-                       return ( tag | settings->tag_magic );
+                       return tag;
                if ( *tmp != '.' )
                        return 0;
                tmp++;
@@ -1193,7 +1191,8 @@ parse_setting_name ( const char *name,
        }
 
        /* Identify setting */
-       setting->tag = parse_setting_tag ( *settings, setting_name );
+       setting->tag = parse_setting_tag ( setting_name );
+       setting->scope = (*settings)->default_scope;
        setting->name = setting_name;
        for_each_table_entry ( named_setting, SETTINGS ) {
                /* Matches a defined named setting; use that setting */
@@ -1998,26 +1997,15 @@ struct builtin_setting_operation {
        int ( * fetch ) ( void *data, size_t len );
 };
 
-/** Built-in setting tag magic */
-#define BUILTIN_SETTING_TAG_MAGIC 0xb1
-
-/**
- * Construct built-in setting tag
- *
- * @v id               Unique identifier
- * @ret tag            Setting tag
- */
-#define BUILTIN_SETTING_TAG( id ) ( ( BUILTIN_SETTING_TAG_MAGIC << 24 ) | (id) )
-
-/** "errno" setting tag */
-#define BUILTIN_SETTING_TAG_ERRNO BUILTIN_SETTING_TAG ( 0x01 )
+/** Built-in setting scope */
+static struct settings_scope builtin_scope;
 
 /** Error number setting */
 struct setting errno_setting __setting ( SETTING_MISC ) = {
        .name = "errno",
        .description = "Last error",
-       .tag = BUILTIN_SETTING_TAG_ERRNO,
        .type = &setting_type_uint32,
+       .scope = &builtin_scope,
 };
 
 /**
@@ -2038,15 +2026,12 @@ static int errno_fetch ( void *data, size_t len ) {
        return sizeof ( content );
 }
 
-/** "buildarch" setting tag */
-#define BUILTIN_SETTING_TAG_BUILDARCH BUILTIN_SETTING_TAG ( 0x02 )
-
 /** Build architecture setting */
 struct setting buildarch_setting __setting ( SETTING_MISC ) = {
        .name = "buildarch",
        .description = "Build architecture",
-       .tag = BUILTIN_SETTING_TAG_BUILDARCH,
        .type = &setting_type_string,
+       .scope = &builtin_scope,
 };
 
 /**
@@ -2063,15 +2048,12 @@ static int buildarch_fetch ( void *data, size_t len ) {
        return ( sizeof ( buildarch ) - 1 /* NUL */ );
 }
 
-/** "platform" setting tag */
-#define BUILTIN_SETTING_TAG_PLATFORM BUILTIN_SETTING_TAG ( 0x03 )
-
 /** Platform setting */
 struct setting platform_setting __setting ( SETTING_MISC ) = {
        .name = "platform",
        .description = "Platform",
-       .tag = BUILTIN_SETTING_TAG_PLATFORM,
        .type = &setting_type_string,
+       .scope = &builtin_scope,
 };
 
 /**
@@ -2128,11 +2110,8 @@ static int builtin_fetch ( struct settings *settings __unused,
  */
 static int builtin_applies ( struct settings *settings __unused,
                             struct setting *setting ) {
-       unsigned int tag_magic;
 
-       /* Check tag magic */
-       tag_magic = ( setting->tag >> 24 );
-       return ( tag_magic == BUILTIN_SETTING_TAG_MAGIC );
+       return ( setting->scope == &builtin_scope );
 }
 
 /** Built-in settings operations */
@@ -2144,7 +2123,6 @@ static struct settings_operations builtin_settings_operations = {
 /** Built-in settings */
 static struct settings builtin_settings = {
        .refcnt = NULL,
-       .tag_magic = BUILTIN_SETTING_TAG ( 0 ),
        .siblings = LIST_HEAD_INIT ( builtin_settings.siblings ),
        .children = LIST_HEAD_INIT ( builtin_settings.children ),
        .op = &builtin_settings_operations,
index 1c798e04a4e61899196173751a466e7a4ed34933..7f2fe0b6396417903fc72d83c1335edc3df80d2b 100644 (file)
@@ -1454,11 +1454,8 @@ static struct net_device_operations phantom_operations = {
  *
  */
 
-/** Phantom CLP settings tag magic */
-#define PHN_CLP_TAG_MAGIC 0xc19c1900UL
-
-/** Phantom CLP settings tag magic mask */
-#define PHN_CLP_TAG_MAGIC_MASK 0xffffff00UL
+/** Phantom CLP settings scope */
+static struct settings_scope phantom_settings_scope;
 
 /** Phantom CLP data
  *
@@ -1689,8 +1686,8 @@ phantom_clp_setting ( struct phantom_nic *phantom, struct setting *setting ) {
        }
 
        /* Allow for use of numbered settings */
-       if ( ( setting->tag & PHN_CLP_TAG_MAGIC_MASK ) == PHN_CLP_TAG_MAGIC )
-               return ( setting->tag & ~PHN_CLP_TAG_MAGIC_MASK );
+       if ( setting->scope == &phantom_settings_scope )
+               return setting->tag;
 
        DBGC2 ( phantom, "Phantom %p has no \"%s\" setting\n",
                phantom, setting->name );
@@ -2075,7 +2072,7 @@ static int phantom_probe ( struct pci_device *pci ) {
        assert ( phantom->port < PHN_MAX_NUM_PORTS );
        settings_init ( &phantom->settings,
                        &phantom_settings_operations,
-                       &netdev->refcnt, PHN_CLP_TAG_MAGIC );
+                       &netdev->refcnt, &phantom_settings_scope );
 
        /* Fix up PCI device */
        adjust_pci_device ( pci );
index 771872c82fb9b64c2dbfebdadcf824f7230d4346..dd8bd228868cdde8b3ad9d48f974cf1e4c2318bc 100644 (file)
@@ -1183,25 +1183,4 @@ static inline u16 net80211_cts_duration ( struct net80211_device *dev,
                 net80211_duration ( dev, size, dev->rates[dev->rate] ) );
 }
 
-/** 802.11 device setting tag magic */
-#define NET80211_SETTING_TAG_MAGIC 0x8211
-
-/**
- * Construct 802.11 setting tag
- *
- * @v id               Unique identifier
- * @ret tag            Setting tag
- */
-#define NET80211_SETTING_TAG( id ) \
-       NETDEV_SETTING_TAG ( ( NET80211_SETTING_TAG_MAGIC << 8 ) | (id) )
-
-/** SSID setting tag */
-#define NET80211_SETTING_TAG_SSID NET80211_SETTING_TAG ( 0x01 )
-
-/** Active scanning setting tag */
-#define NET80211_SETTING_TAG_ACTIVE_SCAN NET80211_SETTING_TAG ( 0x02 )
-
-/** Wireless key setting tag */
-#define NET80211_SETTING_TAG_KEY NET80211_SETTING_TAG ( 0x03 )
-
 #endif
index 21754fe67fadcdd169429751698542a9f3888724..0daa1d626a8388e0d1e7d1ebd42b380e7ceb2829 100644 (file)
@@ -411,38 +411,6 @@ struct net_driver {
 /** Declare a network driver */
 #define __net_driver __table_entry ( NET_DRIVERS, 01 )
 
-/** Network device setting tag magic
- *
- * All DHCP option settings are deemed to be valid as network device
- * settings.  There are also some extra non-DHCP settings (such as
- * "mac"), which are marked as being valid network device settings by
- * using a magic tag value.
- */
-#define NETDEV_SETTING_TAG_MAGIC 0xeb
-
-/**
- * Construct network device setting tag
- *
- * @v id               Unique identifier
- * @ret tag            Setting tag
- */
-#define NETDEV_SETTING_TAG( id ) ( ( NETDEV_SETTING_TAG_MAGIC << 24 ) | (id) )
-
-/**
- * Check if tag is a network device setting tag
- *
- * @v tag              Setting tag
- * @ret is_ours                Tag is a network device setting tag
- */
-#define IS_NETDEV_SETTING_TAG( tag ) \
-       ( ( (tag) >> 24 ) == NETDEV_SETTING_TAG_MAGIC )
-
-/** MAC address setting tag */
-#define NETDEV_SETTING_TAG_MAC NETDEV_SETTING_TAG ( 0x01 )
-
-/** Bus ID setting tag */
-#define NETDEV_SETTING_TAG_BUS_ID NETDEV_SETTING_TAG ( 0x02 )
-
 extern struct list_head net_devices;
 extern struct net_device_operations null_netdev_operations;
 extern struct settings_operations netdev_settings_operations;
index 3f8876020a5ffb1fb1d3c8e72d5e32f361fc865f..9b7404ac25b4971d43cff46235bc9e84a8921af8 100644 (file)
@@ -38,27 +38,14 @@ struct setting {
         * The setting tag is a numerical description of the setting
         * (such as a DHCP option number, or an SMBIOS structure and
         * field number).
-        *
-        * Users can construct tags for settings that are not
-        * explicitly known to iPXE using the generic syntax for
-        * numerical settings.  For example, the setting name "60"
-        * will be interpreted as referring to DHCP option 60 (the
-        * vendor class identifier).
-        *
-        * This creates a potential for namespace collisions, since
-        * the interpretation of the numerical description will vary
-        * according to the settings block.  When a user attempts to
-        * fetch a generic numerical setting, we need to ensure that
-        * only the intended settings block interprets the numerical
-        * description.  (For example, we do not want to attempt to
-        * retrieve the subnet mask from SMBIOS, or the system UUID
-        * from DHCP.)
-        *
-        * This potential problem is resolved by allowing the setting
-        * tag to include a "magic" value indicating the
-        * interpretation to be placed upon the numerical description.
         */
        unsigned int tag;
+       /** Setting scope (or NULL)
+        *
+        * For historic reasons, a NULL scope with a non-zero tag
+        * indicates a DHCPv4 option setting.
+        */
+       struct settings_scope *scope;
 };
 
 /** Configuration setting table */
@@ -134,12 +121,6 @@ struct settings {
        struct refcnt *refcnt;
        /** Name */
        const char *name;
-       /** Tag magic
-        *
-        * This value will be ORed in to any numerical tags
-        * constructed by parse_setting_name().
-        */
-       unsigned int tag_magic;
        /** Parent settings block */
        struct settings *parent;
        /** Sibling settings blocks */
@@ -148,8 +129,44 @@ struct settings {
        struct list_head children;
        /** Settings block operations */
        struct settings_operations *op;
+       /** Default scope for numerical settings constructed for this block */
+       struct settings_scope *default_scope;
 };
 
+/**
+ * A setting scope
+ *
+ * Users can construct tags for settings that are not explicitly known
+ * to iPXE using the generic syntax for numerical settings.  For
+ * example, the setting name "60" will be interpreted as referring to
+ * DHCP option 60 (the vendor class identifier).
+ *
+ * This creates a potential for namespace collisions, since the
+ * interpretation of the numerical description will vary according to
+ * the settings block.  When a user attempts to fetch a generic
+ * numerical setting, we need to ensure that only the intended
+ * settings blocks interpret this numerical description.  (For
+ * example, we do not want to attempt to retrieve the subnet mask from
+ * SMBIOS, or the system UUID from DHCP.)
+ *
+ * This potential problem is resolved by including a user-invisible
+ * "scope" within the definition of each setting.  Settings blocks may
+ * use this to determine whether or not the setting is applicable.
+ * Any settings constructed from a numerical description
+ * (e.g. "smbios/1.4.0") will be assigned the default scope of the
+ * settings block specified in the description (e.g. "smbios"); this
+ * provides behaviour matching the user's expectations in most
+ * circumstances.
+ */
+struct settings_scope {
+       /** Dummy field
+        *
+        * This is included only to ensure that pointers to different
+        * scopes always compare differently.
+        */
+       uint8_t dummy;
+} __attribute__ (( packed ));
+
 /**
  * A setting type
  *
@@ -329,17 +346,17 @@ extern struct setting busid_setting __setting ( SETTING_NETDEV );
  * @v settings         Settings block
  * @v op               Settings block operations
  * @v refcnt           Containing object reference counter, or NULL
- * @v tag_magic                Tag magic
+ * @v default_scope    Default scope
  */
 static inline void settings_init ( struct settings *settings,
                                   struct settings_operations *op,
                                   struct refcnt *refcnt,
-                                  unsigned int tag_magic ) {
+                                  struct settings_scope *default_scope ) {
        INIT_LIST_HEAD ( &settings->siblings );
        INIT_LIST_HEAD ( &settings->children );
        settings->op = op;
        settings->refcnt = refcnt;
-       settings->tag_magic = tag_magic;
+       settings->default_scope = default_scope;
 }
 
 /**
@@ -351,7 +368,7 @@ static inline void settings_init ( struct settings *settings,
 static inline void generic_settings_init ( struct generic_settings *generics,
                                           struct refcnt *refcnt ) {
        settings_init ( &generics->settings, &generic_settings_operations,
-                       refcnt, 0 );
+                       refcnt, NULL );
        INIT_LIST_HEAD ( &generics->list );
 }
 
index 663da96872c3d9c2e11cc17e267bd76ab55d9299..7b2efcd7232c347fbbe2f4b6e1f0f395af24be50 100644 (file)
@@ -27,15 +27,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/uuid.h>
 #include <ipxe/smbios.h>
 
-/** SMBIOS settings tag magic number */
-#define SMBIOS_TAG_MAGIC 0x5B /* "SmBios" */
-
-/**
- * Construct SMBIOS empty tag
- *
- * @ret tag            SMBIOS setting tag
- */
-#define SMBIOS_EMPTY_TAG ( SMBIOS_TAG_MAGIC << 24 )
+/** SMBIOS settings scope */
+static struct settings_scope smbios_settings_scope;
 
 /**
  * Construct SMBIOS raw-data tag
@@ -46,8 +39,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * @ret tag            SMBIOS setting tag
  */
 #define SMBIOS_RAW_TAG( _type, _structure, _field )            \
-       ( ( SMBIOS_TAG_MAGIC << 24 ) |                          \
-         ( (_type) << 16 ) |                                   \
+       ( ( (_type) << 16 ) |                                   \
          ( offsetof ( _structure, _field ) << 8 ) |            \
          ( sizeof ( ( ( _structure * ) 0 )->_field ) ) )
 
@@ -60,8 +52,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * @ret tag            SMBIOS setting tag
  */
 #define SMBIOS_STRING_TAG( _type, _structure, _field )         \
-       ( ( SMBIOS_TAG_MAGIC << 24 ) |                          \
-         ( (_type) << 16 ) |                                   \
+       ( ( (_type) << 16 ) |                                   \
          ( offsetof ( _structure, _field ) << 8 ) )
 
 /**
@@ -73,11 +64,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
  */
 static int smbios_applies ( struct settings *settings __unused,
                            struct setting *setting ) {
-       unsigned int tag_magic;
 
-       /* Check tag magic */
-       tag_magic = ( setting->tag >> 24 );
-       return ( tag_magic == SMBIOS_TAG_MAGIC );
+       return ( setting->scope == &smbios_settings_scope );
 }
 
 /**
@@ -93,18 +81,15 @@ static int smbios_fetch ( struct settings *settings __unused,
                          struct setting *setting,
                          void *data, size_t len ) {
        struct smbios_structure structure;
-       unsigned int tag_magic;
        unsigned int tag_type;
        unsigned int tag_offset;
        unsigned int tag_len;
        int rc;
 
        /* Split tag into type, offset and length */
-       tag_magic = ( setting->tag >> 24 );
        tag_type = ( ( setting->tag >> 16 ) & 0xff );
        tag_offset = ( ( setting->tag >> 8 ) & 0xff );
        tag_len = ( setting->tag & 0xff );
-       assert ( tag_magic == SMBIOS_TAG_MAGIC );
 
        /* Find SMBIOS structure */
        if ( ( rc = find_smbios_structure ( tag_type, &structure ) ) != 0 )
@@ -170,10 +155,10 @@ static struct settings_operations smbios_settings_operations = {
 /** SMBIOS settings */
 static struct settings smbios_settings = {
        .refcnt = NULL,
-       .tag_magic = SMBIOS_EMPTY_TAG,
        .siblings = LIST_HEAD_INIT ( smbios_settings.siblings ),
        .children = LIST_HEAD_INIT ( smbios_settings.children ),
        .op = &smbios_settings_operations,
+       .default_scope = &smbios_settings_scope,
 };
 
 /** Initialise SMBIOS settings */
@@ -200,6 +185,7 @@ struct setting uuid_setting __setting ( SETTING_HOST ) = {
        .tag = SMBIOS_RAW_TAG ( SMBIOS_TYPE_SYSTEM_INFORMATION,
                                struct smbios_system_information, uuid ),
        .type = &setting_type_uuid,
+       .scope = &smbios_settings_scope,
 };
 
 /** Other SMBIOS named settings */
@@ -211,6 +197,7 @@ struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
                                           struct smbios_system_information,
                                           manufacturer ),
                .type = &setting_type_string,
+               .scope = &smbios_settings_scope,
        },
        {
                .name = "product",
@@ -219,6 +206,7 @@ struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
                                           struct smbios_system_information,
                                           product ),
                .type = &setting_type_string,
+               .scope = &smbios_settings_scope,
        },
        {
                .name = "serial",
@@ -227,6 +215,7 @@ struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
                                           struct smbios_system_information,
                                           serial ),
                .type = &setting_type_string,
+               .scope = &smbios_settings_scope,
        },
        {
                .name = "asset",
@@ -235,5 +224,6 @@ struct setting smbios_named_settings[] __setting ( SETTING_HOST_EXTRA ) = {
                                           struct smbios_enclosure_information,
                                           asset_tag ),
                .type = &setting_type_string,
+               .scope = &smbios_settings_scope,
        },
 };
index 2181fc4ac4a0ee8698b10473e9c541da905923b6..54df79056d867188baa88f53aadad992949f3bb1 100644 (file)
@@ -208,7 +208,6 @@ struct setting net80211_ssid_setting __setting ( SETTING_NETDEV_EXTRA ) = {
        .name = "ssid",
        .description = "Wireless SSID",
        .type = &setting_type_string,
-       .tag = NET80211_SETTING_TAG_SSID,
 };
 
 /** Whether to use active scanning
@@ -221,7 +220,6 @@ struct setting net80211_active_setting __setting ( SETTING_NETDEV_EXTRA ) = {
        .name = "active-scan",
        .description = "Actively scan for wireless networks",
        .type = &setting_type_int8,
-       .tag = NET80211_SETTING_TAG_ACTIVE_SCAN,
 };
 
 /** The cryptographic key to use
@@ -234,7 +232,6 @@ struct setting net80211_key_setting __setting ( SETTING_NETDEV_EXTRA ) = {
        .name = "key",
        .description = "Wireless encryption key",
        .type = &setting_type_string,
-       .tag = NET80211_SETTING_TAG_KEY,
 };
 
 /** @} */
index 528f900372f193f86d938a7f57fab228fbf478a9..3722c09e11985cb4ebb901e99c2f025bbade23ca 100644 (file)
@@ -230,7 +230,8 @@ static int dhcppkt_settings_applies ( struct settings *settings,
        struct dhcp_packet *dhcppkt =
                container_of ( settings, struct dhcp_packet, settings );
 
-       return dhcppkt_applies ( dhcppkt, setting->tag );
+       return ( ( setting->scope == NULL ) &&
+                dhcppkt_applies ( dhcppkt, setting->tag ) );
 }
 
 /**
@@ -299,6 +300,6 @@ void dhcppkt_init ( struct dhcp_packet *dhcppkt, struct dhcphdr *data,
        dhcpopt_init ( &dhcppkt->options, &dhcppkt->dhcphdr->options,
                       ( len - offsetof ( struct dhcphdr, options ) ),
                       dhcpopt_no_realloc );
-       settings_init ( &dhcppkt->settings,
-                       &dhcppkt_settings_operations, &dhcppkt->refcnt, 0 );
+       settings_init ( &dhcppkt->settings, &dhcppkt_settings_operations,
+                       &dhcppkt->refcnt, NULL );
 }
index 9efe6811c3ab8b8b69122d4af2771aa9eded489e..8758e9800cb958aa214b5e79016e9eef1ec8cbfa 100644 (file)
@@ -39,29 +39,13 @@ struct setting mac_setting __setting ( SETTING_NETDEV ) = {
        .name = "mac",
        .description = "MAC address",
        .type = &setting_type_hex,
-       .tag = NETDEV_SETTING_TAG_MAC,
 };
 struct setting busid_setting __setting ( SETTING_NETDEV ) = {
        .name = "busid",
        .description = "Bus ID",
        .type = &setting_type_hex,
-       .tag = NETDEV_SETTING_TAG_BUS_ID,
 };
 
-/**
- * Check applicability of network device setting
- *
- * @v settings         Settings block
- * @v setting          Setting
- * @ret applies                Setting applies within this settings block
- */
-static int netdev_applies ( struct settings *settings __unused,
-                           struct setting *setting ) {
-
-       return ( IS_NETDEV_SETTING_TAG ( setting->tag ) ||
-                dhcpopt_applies ( setting->tag ) );
-}
-
 /**
  * Store value of network device setting
  *
@@ -134,7 +118,6 @@ static void netdev_clear ( struct settings *settings ) {
 
 /** Network device configuration settings operations */
 struct settings_operations netdev_settings_operations = {
-       .applies = netdev_applies,
        .store = netdev_store,
        .fetch = netdev_fetch,
        .clear = netdev_clear,