mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-03-02 15:43:49 +01:00
T#8151 PPP interface reset disrupts ongoing cwmp session
This commit is contained in:
parent
be72f5d309
commit
dab5213fcb
2 changed files with 6 additions and 19 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue