summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-06 17:32:43 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-06 17:32:43 +0200
commitb32763bc5d759ba2e8e18eeacd0c66d06aeb7878 (patch)
treef914dd970a65d1daa421c06c51fd58a06fd80337
parentb357d5f359f32f9f686fe77c63580ecbf6212501 (diff)
fix parsing settings for devices on reload
-rw-r--r--device.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/device.c b/device.c
index 32fa4a4..ef9642f 100644
--- a/device.c
+++ b/device.c
@@ -340,23 +340,23 @@ enum dev_change_type
device_reload_config(struct device *dev, struct blob_attr *attr)
{
struct blob_attr *tb[__DEV_ATTR_MAX], *tb1[__DEV_ATTR_MAX];
- const struct config_param_list *params = dev->type->config_params;
+ const struct config_param_list *cfg = dev->type->config_params;
- blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb,
+ blobmsg_parse(cfg->params, cfg->n_params, tb,
blob_data(attr), blob_len(attr));
if (dev->config)
- blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb1,
+ blobmsg_parse(cfg->params, cfg->n_params, tb1,
blob_data(dev->config), blob_len(dev->config));
else
memset(tb1, 0, sizeof(tb1));
- if (!config_diff(tb, tb1, dev->type->config_params, NULL))
+ if (!config_diff(tb, tb1, cfg, NULL))
return DEV_CONFIG_NO_CHANGE;
- device_init_settings(dev, tb);
- if (params == &device_attr_list)
+ if (cfg == &device_attr_list) {
+ device_init_settings(dev, tb);
return DEV_CONFIG_APPLIED;
- else
+ } else
return DEV_CONFIG_RECREATE;
}