mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
IP.Interface: setting 'mtu' option in device section instead of interface section
This commit is contained in:
parent
f251f5ca0e
commit
a929355ff4
1 changed files with 16 additions and 1 deletions
|
|
@ -1458,13 +1458,28 @@ static int get_IPInterface_MaxMTUSize(char *refparam, struct dmctx *ctx, void *d
|
|||
|
||||
static int set_IPInterface_MaxMTUSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
|
||||
{
|
||||
char *device = NULL;
|
||||
struct uci_section *s = NULL;
|
||||
|
||||
switch (action) {
|
||||
case VALUECHECK:
|
||||
if (bbfdm_validate_unsignedInt(ctx, value, RANGE_ARGS{{"64","65535"}}, 1))
|
||||
return FAULT_9007;
|
||||
break;
|
||||
case VALUESET:
|
||||
dmuci_set_value_by_section((struct uci_section *)data, "mtu", value);
|
||||
/* find the device section for this interface */
|
||||
dmuci_get_value_by_section_string((struct uci_section *)data, "device", &device);
|
||||
|
||||
/* check if device is empty */
|
||||
if ((device)[0] == '\0') {
|
||||
return FAULT_9002;
|
||||
}
|
||||
|
||||
/* set option MTU in device section */
|
||||
uci_foreach_option_eq("network", "device", "name", device, s) {
|
||||
dmuci_set_value_by_section(s, "mtu", value);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue