summaryrefslogtreecommitdiffhomepage
path: root/src/router.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2017-05-11 16:50:14 +0200
committerHans Dedecker <dedeckeh@gmail.com>2017-05-11 16:58:59 +0200
commite4504db88c5b501142cc97a08876d924d673f605 (patch)
tree490f3148eac6be6e6e186deb553084b4793cf6cc /src/router.c
parent9dd5316deae6402de68ddc8a08d1a6b496101828 (diff)
config: make RA curHopLimit configurable via uci
Allow to specify the router advertisement current hop limit via the uci parameter ra_hoplimit. If hoplimit is not configured the hoplimit is taken from the interface as before. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/router.c')
-rw-r--r--src/router.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/router.c b/src/router.c
index a31bf4e..faf9e9d 100644
--- a/src/router.c
+++ b/src/router.c
@@ -260,7 +260,7 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
{
time_t now = odhcpd_time();
uint32_t mtu = iface->ra_mtu;
- int hlim = odhcpd_get_interface_config(iface->ifname, "hop_limit");
+ int hlim = iface->ra_hoplimit;
if (mtu == 0)
mtu = odhcpd_get_interface_config(iface->ifname, "mtu");
@@ -268,6 +268,9 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add
if (mtu < 1280)
mtu = 1280;
+ if (hlim == 0)
+ hlim = odhcpd_get_interface_config(iface->ifname, "hop_limit");
+
struct {
struct nd_router_advert h;
struct icmpv6_opt lladdr;