X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=f905a7836d2ba601d5b98c5a10d72e77bd53da34;hp=e9e6aafe0c260394081e067191477dbb5eddacdf;hb=e1b11c518aded9136b4f44759c6e2a6be4161ee9;hpb=a76c62d6a528d7b22aff49f5fd662af02976cfbe diff --git a/src/dhcpv6.c b/src/dhcpv6.c index e9e6aaf..f905a78 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -60,7 +60,7 @@ static int dhcpv6_commit_advert(void); static struct dhcpv6_retx dhcpv6_retx[_DHCPV6_MSG_MAX] = { [DHCPV6_MSG_UNKNOWN] = {false, 1, 120, "", dhcpv6_handle_reconfigure, NULL}, - [DHCPV6_MSG_SOLICIT] = {true, 1, 3600, "SOLICIT", + [DHCPV6_MSG_SOLICIT] = {true, 1, 120, "SOLICIT", dhcpv6_handle_advert, dhcpv6_commit_advert}, [DHCPV6_MSG_REQUEST] = {true, 1, 30, "REQUEST", dhcpv6_handle_reply, NULL}, @@ -90,9 +90,10 @@ static uint8_t reconf_key[16]; -int init_dhcpv6(const char *ifname, int request_pd) +int init_dhcpv6(const char *ifname, int request_pd, int sol_timeout) { request_prefix = request_pd; + dhcpv6_retx[DHCPV6_MSG_SOLICIT].max_timeo = sol_timeout; sock = socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_UDP); @@ -598,7 +599,7 @@ static int dhcpv6_handle_advert(enum dhcpv6_msg orig, dhcpv6_for_each_option(&h[1], oend, otype, olen, d) { if (otype == DHCPV6_OPT_IA_PREFIX && (olen + 4) >= (uint16_t)sizeof(struct dhcpv6_ia_prefix)) { - struct dhcpv6_ia_prefix *p = (struct dhcpv6_ia_prefix*)&odata[-4]; + struct dhcpv6_ia_prefix *p = (struct dhcpv6_ia_prefix*)&d[-4]; have_pd = p->prefix; } }