config: limit ra_retranstime to 60000
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 15 May 2017 13:58:46 +0000 (15:58 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 15 May 2017 14:01:28 +0000 (16:01 +0200)
Limit the maximum ra_retranstime value to 60000 milliseconds as
described in RFC7048.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/config.c

index 93489852d7986b31d3a75e60079826556499b2c1..979603c715658b29e65b3b7423006f2d7469fb88 100644 (file)
@@ -608,8 +608,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
                        goto err;
        }
 
-       if ((c = tb[IFACE_ATTR_RA_RETRANSTIME]))
+       if ((c = tb[IFACE_ATTR_RA_RETRANSTIME])) {
                iface->ra_retranstime = blobmsg_get_u32(c);
+               if (iface->ra_retranstime > 60000)
+                       goto err;
+       }
 
        if ((c = tb[IFACE_ATTR_RA_HOPLIMIT])) {
                iface->ra_hoplimit = blobmsg_get_u32(c);