diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-09-28 09:55:07 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-09-28 09:55:07 +0200 |
commit | 5479d6f1eefd1e5a7258b9eedbf92214a95db819 (patch) | |
tree | f505efd40f5f45358c1eebfc4bf5989a712efe01 /device.c | |
parent | 2bf80ba8c5ab4d01c6e8eb1b7ecebefea7f2d530 (diff) |
device: ignore MTU values below minimum
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -240,12 +240,12 @@ device_init_settings(struct device *dev, struct blob_attr **tb) if ((cur = tb[DEV_ATTR_ENABLED])) disabled = !blobmsg_get_bool(cur); - if ((cur = tb[DEV_ATTR_MTU])) { + if ((cur = tb[DEV_ATTR_MTU]) && blobmsg_get_u32(cur) >= 68) { s->mtu = blobmsg_get_u32(cur); s->flags |= DEV_OPT_MTU; } - if ((cur = tb[DEV_ATTR_MTU6])) { + if ((cur = tb[DEV_ATTR_MTU6]) && blobmsg_get_u32(cur) >= 1280) { s->mtu6 = blobmsg_get_u32(cur); s->flags |= DEV_OPT_MTU6; } |