From 77bffe53a98653c405d49e69ba2ed602c4f5090b Mon Sep 17 00:00:00 2001 From: Imen Bhiri Date: Wed, 7 Oct 2015 09:49:35 +0100 Subject: [PATCH] #issue 7928: Channel selection mode --- dm/dmtree/landevice.c | 8 ++++---- dm/dmtree/wandevice.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dm/dmtree/landevice.c b/dm/dmtree/landevice.c index b9cdfe2..b7f0679 100644 --- a/dm/dmtree/landevice.c +++ b/dm/dmtree/landevice.c @@ -1953,7 +1953,7 @@ int set_wlan_basic_authentication_mode(char *refparam, struct dmctx *ctx, int ac } } dmuci_set_value_by_section(wlanargs->lwlansection, "encryption", "wep-open"); - } else if (strcmp(value, "None")) { + } else if (strcmp(value, "None") == 0) { reset_wlan(wlanargs->lwlansection); dmuci_set_value_by_section(wlanargs->lwlansection, "encryption", "none"); } @@ -2417,7 +2417,7 @@ int get_x_inteno_se_channelmode(char *refparam, struct dmctx *ctx, char **value) { struct ldwlanargs *wlanargs = (struct ldwlanargs *)ctx->args; dmuci_get_value_by_section_string(wlanargs->device_section, "channel", value); - if (strcmp(*value, "auto") || (*value)[0] == '\0') + if (strcmp(*value, "auto") == 0 || (*value)[0] == '\0') *value = "Auto"; else *value = "Manual"; @@ -2433,9 +2433,9 @@ int set_x_inteno_se_channelmode(char *refparam, struct dmctx *ctx, int action, c case VALUECHECK: return 0; case VALUESET: - if (strcmp(value, "Auto")) + if (strcmp(value, "Auto") == 0) dmuci_set_value_by_section(wlanargs->device_section, "channel", "auto"); - else if (strcmp(value, "Manual")) { + else if (strcmp(value, "Manual") == 0) { if (wlanargs->res != NULL) { json_select(wlanargs->res, "channel", 0, NULL, &channel, NULL); if (channel[0] != '\0') diff --git a/dm/dmtree/wandevice.c b/dm/dmtree/wandevice.c index 5a0c120..7783bd3 100644 --- a/dm/dmtree/wandevice.c +++ b/dm/dmtree/wandevice.c @@ -1376,7 +1376,7 @@ int get_wan_igmp_rule_idx(char *iface, struct uci_section **rule, struct uci_sec dmuci_get_value_by_section_string(*zone, "name", &zname); uci_foreach_option_cont("firewall", "rule", "src", zname, *rule) { dmuci_get_value_by_section_string(*rule, "proto", &proto); - if (strcmp(proto, "igmp")) { + if (strcmp(proto, "igmp") == 0) { dmuci_get_value_by_section_string(*rule, "enabled", enable); if ((*enable)[0] != '\0') { if ((*enable)[0] == '0')