X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Frouter.c;h=7600e2f0a7ae503bcba1e3509ef24796a976b712;hp=a31bf4e0f2584b8bb8b6febc535410ad67a36867;hb=2cb6b4872a1981f2acce40018107481c82a529dc;hpb=9dd5316deae6402de68ddc8a08d1a6b496101828 diff --git a/src/router.c b/src/router.c index a31bf4e..7600e2f 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; @@ -292,6 +295,9 @@ static uint64_t send_router_advert(struct interface *iface, const struct in6_add adv.h.nd_ra_flags_reserved |= ND_RA_PREF_LOW; else if (iface->route_preference > 0) adv.h.nd_ra_flags_reserved |= ND_RA_PREF_HIGH; + + adv.h.nd_ra_reachable = htonl(iface->ra_reachabletime); + odhcpd_get_mac(iface, adv.lladdr.data); // If not currently shutting down