ATM,PTM: remove unknown status

This commit is contained in:
Amin Ben Ramdhane 2021-02-11 16:11:16 +01:00
parent 20d5f3bf82
commit d5a55c8f4c
2 changed files with 2 additions and 12 deletions

View file

@ -231,12 +231,7 @@ static int set_atm_enable(char *refparam, struct dmctx *ctx, void *data, char *i
static int get_atm_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
get_net_device_sysfs(((struct atm_args *)data)->ifname, "operstate", value);
if (strcmp(*value, "up") == 0)
*value = "Up";
else if (strcmp(*value, "down") == 0)
*value = "Down";
else
*value = "Unknown";
*value = (strcmp(*value, "up") == 0) ? "Up" : "Down";
return 0;
}

View file

@ -128,12 +128,7 @@ static int set_ptm_enable(char *refparam, struct dmctx *ctx, void *data, char *i
static int get_ptm_status(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
get_net_device_sysfs(((struct ptm_args *)data)->ifname, "operstate", value);
if (strcmp(*value, "up") == 0)
*value = "Up";
else if (strcmp(*value, "down") == 0)
*value = "Down";
else
*value = "Unknown";
*value = (strcmp(*value, "up") == 0) ? "Up" : "Down";
return 0;
}