config: fix invalid retranstime in RA message
authorHans Dedecker <dedeckeh@gmail.com>
Mon, 15 May 2017 17:59:03 +0000 (19:59 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Mon, 15 May 2017 18:05:55 +0000 (20:05 +0200)
Don't send an invalid retranstime in RA message when
the interface is shutdown due to a invalid configured
ra_retranstime.

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

index 2369372a62ee3e46d18e007122e1321dbbd01fb5..9b4fa461068423d504737eabe3631dcbfe92270b 100644 (file)
@@ -611,9 +611,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
        }
 
        if ((c = tb[IFACE_ATTR_RA_RETRANSTIME])) {
-               iface->ra_retranstime = blobmsg_get_u32(c);
-               if (iface->ra_retranstime > 60000)
+               uint32_t ra_retranstime = blobmsg_get_u32(c);
+               if (ra_retranstime > 60000)
                        goto err;
+
+               iface->ra_retranstime = ra_retranstime;
        }
 
        if ((c = tb[IFACE_ATTR_RA_HOPLIMIT])) {