diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-05-12 10:53:25 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-05-12 10:53:25 +0200 |
commit | a9e9bc4c67ac9fa8aecf5f20954a58093705831b (patch) | |
tree | d32d1628130e0730f4ca4642427a6dbf3e21bafd /src/config.c | |
parent | 2cb6b4872a1981f2acce40018107481c82a529dc (diff) |
config: make RA retransTime configurable via uci
Allow to specify the router advertisement retrans time via the uci
parameter ra_retranstime. If retransmit time is not configured the
value is set to 0 in RA message meaning undefined.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c index 211ac1f..9348985 100644 --- a/src/config.c +++ b/src/config.c @@ -51,6 +51,7 @@ enum { IFACE_ATTR_RA_LIFETIME, IFACE_ATTR_RA_USELEASETIME, IFACE_ATTR_RA_REACHABLETIME, + IFACE_ATTR_RA_RETRANSTIME, IFACE_ATTR_RA_HOPLIMIT, IFACE_ATTR_RA_MTU, IFACE_ATTR_PD_MANAGER, @@ -92,6 +93,7 @@ static const struct blobmsg_policy iface_attrs[IFACE_ATTR_MAX] = { [IFACE_ATTR_RA_LIFETIME] = { .name = "ra_lifetime", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_RA_USELEASETIME] = { .name = "ra_useleasetime", .type = BLOBMSG_TYPE_BOOL }, [IFACE_ATTR_RA_REACHABLETIME] = { .name = "ra_reachabletime", .type = BLOBMSG_TYPE_INT32 }, + [IFACE_ATTR_RA_RETRANSTIME] = { .name = "ra_retranstime", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_RA_HOPLIMIT] = { .name = "ra_hoplimit", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_RA_MTU] = { .name = "ra_mtu", .type = BLOBMSG_TYPE_INT32 }, [IFACE_ATTR_NDPROXY_ROUTING] = { .name = "ndproxy_routing", .type = BLOBMSG_TYPE_BOOL }, @@ -606,6 +608,9 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr goto err; } + if ((c = tb[IFACE_ATTR_RA_RETRANSTIME])) + iface->ra_retranstime = blobmsg_get_u32(c); + if ((c = tb[IFACE_ATTR_RA_HOPLIMIT])) { iface->ra_hoplimit = blobmsg_get_u32(c); if (iface->ra_hoplimit > 255) |