summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-05-15 20:02:40 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-05-15 20:06:23 +0200
commit93abe6f02ad6e050996c4ead2481f103417df64f (patch)
tree41d85a17af9eaef21e9ed3a3990a22d393cc35cc /src/config.c
parent2ae08d1fe4cd1e8bda92c2ce33438e400ad5ffa4 (diff)
config: fix invalid hoplimit in RA message
Don't send an invalid hoplimit in RA message when the interface is shutdown due to a invalid configured ra_hoplimit. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c
index 9b4fa46..7940095 100644
--- a/src/config.c
+++ b/src/config.c
@@ -619,9 +619,11 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
}
if ((c = tb[IFACE_ATTR_RA_HOPLIMIT])) {
- iface->ra_hoplimit = blobmsg_get_u32(c);
- if (iface->ra_hoplimit > 255)
+ uint32_t ra_hoplimit = blobmsg_get_u32(c);
+ if (ra_hoplimit > 255)
goto err;
+
+ iface->ra_hoplimit = ra_hoplimit;
}
if ((c = tb[IFACE_ATTR_RA_MTU])) {