diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-05-15 17:42:52 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-05-15 20:04:56 +0200 |
commit | 5683dd25da56c66e0a5c86e770b8ee2188ad569c (patch) | |
tree | 63101d3e9ddd8a0b264054f868bfe0f7223f0840 /src | |
parent | f8d40a5b25b47f145f20ca83d5581428cb6a4e2c (diff) |
config: limit ra_mtu to 65535
Limit the maximum ra_mtu to 65535
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/config.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index 979603c..fd334ef 100644 --- a/src/config.c +++ b/src/config.c @@ -621,9 +621,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr } if ((c = tb[IFACE_ATTR_RA_MTU])) { - iface->ra_mtu = blobmsg_get_u32(c); - if (iface->ra_mtu < 1280) + uint32_t ra_mtu = blobmsg_get_u32(c); + if (ra_mtu < 1280 || ra_mtu > 65535) goto err; + + iface->ra_mtu = ra_mtu; } if ((c = tb[IFACE_ATTR_RA_OFFLINK])) |