diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-08-08 13:54:19 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-08-08 16:28:13 +0800 |
commit | 2b41985dde73e71daad90c36fa5d06c199da3ae1 (patch) | |
tree | 1996c9afb30c85f427977edffcd40352cfaf8ff0 /discover/network.c | |
parent | d6166b471a9356355ed16747de3c0febd4b8cd3e (diff) | |
download | talos-petitboot-2b41985dde73e71daad90c36fa5d06c199da3ae1.tar.gz talos-petitboot-2b41985dde73e71daad90c36fa5d06c199da3ae1.zip |
config: Split interface configuration from network configuration
This change moves the interface configuration into its own 'struct
interface_config'. We also remove the _config suffix from the network
and interface members.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/network.c')
-rw-r--r-- | discover/network.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/discover/network.c b/discover/network.c index 23bf1ee..910649e 100644 --- a/discover/network.c +++ b/discover/network.c @@ -53,7 +53,7 @@ struct network { bool dry_run; }; -static const struct network_config *find_config_by_hwaddr( +static const struct interface_config *find_config_by_hwaddr( uint8_t *hwaddr) { const struct config *config; @@ -63,11 +63,11 @@ static const struct network_config *find_config_by_hwaddr( if (!config) return NULL; - for (i = 0; i < config->n_network_configs; i++) { - struct network_config *netconf = config->network_configs[i]; + for (i = 0; i < config->network.n_interfaces; i++) { + struct interface_config *ifconf = config->network.interfaces[i]; - if (!memcmp(netconf->hwaddr, hwaddr, HWADDR_SIZE)) - return netconf; + if (!memcmp(ifconf->hwaddr, hwaddr, HWADDR_SIZE)) + return ifconf; } return NULL; @@ -191,7 +191,7 @@ static void configure_interface_dhcp(struct network *network, static void configure_interface_static(struct network *network, struct interface *interface, - const struct network_config *config) + const struct interface_config *config) { const char *addr_argv[] = { pb_system_apps.ip, @@ -242,7 +242,7 @@ static void configure_interface_static(struct network *network, static void configure_interface(struct network *network, struct interface *interface, bool up, bool link) { - const struct network_config *config = NULL; + const struct interface_config *config = NULL; if (interface->state == IFSTATE_IGNORED) return; |