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

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

index fd334ef2e8a3108697ebcf5e7d0ff2ccf9d7f82b..2369372a62ee3e46d18e007122e1321dbbd01fb5 100644 (file)
@@ -603,9 +603,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
                iface->managed = blobmsg_get_u32(c);
 
        if ((c = tb[IFACE_ATTR_RA_REACHABLETIME])) {
-               iface->ra_reachabletime = blobmsg_get_u32(c);
-               if (iface->ra_reachabletime > 3600000)
+               uint32_t ra_reachabletime = blobmsg_get_u32(c);
+               if (ra_reachabletime > 3600000)
                        goto err;
+
+               iface->ra_reachabletime = ra_reachabletime;
        }
 
        if ((c = tb[IFACE_ATTR_RA_RETRANSTIME])) {