X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=afea77f2034950567c100cd95b3e977a91e10e46;hp=c87d289e159687b03aa3fc87f1c9b98b3651c06d;hb=47fac6f603c236d7b149e0ec593269322572b352;hpb=6c8109e0c77d5a54950ba607d1ec1f83d5efb5b7 diff --git a/src/dhcpv6.c b/src/dhcpv6.c index c87d289..afea77f 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -175,6 +175,9 @@ int init_dhcpv6(const char *ifname, unsigned int options, int sol_timeout) htons(DHCPV6_OPT_INF_MAX_RT), #ifdef EXT_PREFIX_CLASS htons(DHCPV6_OPT_PREFIX_CLASS), +#endif +#ifdef EXT_CER_ID + htons(DHCPV6_OPT_CER_ID), #endif }; odhcp6c_add_state(STATE_ORO, oro, sizeof(oro)); @@ -1010,7 +1013,15 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc, if (inf_max_rt >= DHCPV6_INF_MAX_RT_MIN && inf_max_rt <= DHCPV6_INF_MAX_RT_MAX) dhcpv6_retx[DHCPV6_MSG_INFO_REQ].max_timeo = inf_max_rt; - }else if (otype != DHCPV6_OPT_CLIENTID && +#ifdef EXT_CER_ID + } else if (otype == DHCPV6_OPT_CER_ID && olen == -4 + + sizeof(struct dhcpv6_cer_id)) { + struct dhcpv6_cer_id *cer_id = (void*)&odata[-4]; + struct in6_addr any = IN6ADDR_ANY_INIT; + if (memcmp(&cer_id->addr, &any, sizeof(any))) + odhcp6c_add_state(STATE_CER, &cer_id->addr, sizeof(any)); +#endif + } else if (otype != DHCPV6_OPT_CLIENTID && otype != DHCPV6_OPT_SERVERID) { odhcp6c_add_state(STATE_CUSTOM_OPTS, &odata[-4], olen + 4);