Skip to content
Snippets Groups Projects
Verified Commit 1561b71a authored by Vivek Dutta's avatar Vivek Dutta
Browse files

Fix Remote protocol option

parent 8c1092cb
No related branches found
No related tags found
1 merge request!15Fix Remote protocol option
Pipeline #212573 passed
...@@ -884,9 +884,10 @@ static int set_SyslogActionLogRemote_Address(char *refparam, struct dmctx *ctx, ...@@ -884,9 +884,10 @@ static int set_SyslogActionLogRemote_Address(char *refparam, struct dmctx *ctx,
static int get_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value) static int get_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{ {
struct uci_section *r = (struct uci_section *)(((struct action_data *)((struct dm_data *)data)->additional_data)->remote_section);
char *proto; char *proto;
dmuci_get_value_by_section_string(((struct dm_data *)data)->config_section, "proto", &proto); dmuci_get_value_by_section_string(r, "proto", &proto);
if (DM_STRCMP(proto, "tls") == 0) { if (DM_STRCMP(proto, "tls") == 0) {
*value = "TLS"; *value = "TLS";
} else if (DM_STRCMP(proto, "tcp") == 0) { } else if (DM_STRCMP(proto, "tcp") == 0) {
...@@ -900,6 +901,7 @@ static int get_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, ...@@ -900,6 +901,7 @@ static int get_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx,
static int set_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) static int set_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{ {
struct uci_section *r = (struct uci_section *)(((struct action_data *)((struct dm_data *)data)->additional_data)->remote_section);
switch (action) { switch (action) {
case VALUECHECK: case VALUECHECK:
if (bbfdm_validate_string(ctx, value, -1, -1, Protocol, NULL)) if (bbfdm_validate_string(ctx, value, -1, -1, Protocol, NULL))
...@@ -907,11 +909,11 @@ static int set_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx, ...@@ -907,11 +909,11 @@ static int set_SyslogActionLogRemote_Protocol(char *refparam, struct dmctx *ctx,
break; break;
case VALUESET: case VALUESET:
if (strcmp("TCP", value) == 0) if (strcmp("TCP", value) == 0)
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "proto", "tcp"); dmuci_set_value_by_section(r, "proto", "tcp");
else if (strcmp("UDP", value) == 0) else if (strcmp("UDP", value) == 0)
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "proto", "udp"); dmuci_set_value_by_section(r, "proto", "udp");
else if (strcmp("TLS", value) == 0) else if (strcmp("TLS", value) == 0)
dmuci_set_value_by_section(((struct dm_data *)data)->config_section, "proto", "tls"); dmuci_set_value_by_section(r, "proto", "tls");
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment