From dab5213fcb2a7fe6f879623fd469a84b292c3b22 Mon Sep 17 00:00:00 2001 From: suvendhu Date: Mon, 13 Jun 2022 12:59:52 +0530 Subject: [PATCH] T#8151 PPP interface reset disrupts ongoing cwmp session --- dmtree/tr181/ip.c | 12 +++--------- dmtree/tr181/ppp.c | 13 +++---------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/dmtree/tr181/ip.c b/dmtree/tr181/ip.c index 7306ef76..e133bd54 100644 --- a/dmtree/tr181/ip.c +++ b/dmtree/tr181/ip.c @@ -1600,21 +1600,15 @@ static int get_IPInterface_Reset(char *refparam, struct dmctx *ctx, void *data, static int set_IPInterface_Reset(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { - bool b; - switch (action) { case VALUECHECK: if (dm_validate_boolean(value)) return FAULT_9007; break; case VALUESET: - string_to_bool(value, &b); - if (b) { - char interface_obj[64] = {0}; - snprintf(interface_obj, sizeof(interface_obj), "network.interface.%s", section_name(((struct uci_section *)data))); - dmubus_call_set(interface_obj, "down", UBUS_ARGS{0}, 0); - dmubus_call_set(interface_obj, "up", UBUS_ARGS{0}, 0); - } + /* Reset can disrupt on-going cwmp session, so this parameter must be + * taken care by cwmp internally. + */ break; } return 0; diff --git a/dmtree/tr181/ppp.c b/dmtree/tr181/ppp.c index b4a3cac9..efc43653 100644 --- a/dmtree/tr181/ppp.c +++ b/dmtree/tr181/ppp.c @@ -277,22 +277,15 @@ static int get_PPPInterface_Reset(char *refparam, struct dmctx *ctx, void *data, static int set_PPPInterface_Reset(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action) { - struct uci_section *ppp_s = ((struct ppp_args *)data)->iface_s; - bool b; - switch (action) { case VALUECHECK: if (dm_validate_boolean(value)) return FAULT_9007; break; case VALUESET: - string_to_bool(value, &b); - if (b && ppp_s) { - char intf_obj[64] = {0}; - snprintf(intf_obj, sizeof(intf_obj), "network.interface.%s", section_name(ppp_s)); - dmubus_call_set(intf_obj, "down", UBUS_ARGS{0}, 0); - dmubus_call_set(intf_obj, "up", UBUS_ARGS{0}, 0); - } + /* Reset can disrupt on-going cwmp session, so this parameter must be + * taken care by cwmp internally. + */ break; } return 0;