#include "odhcpd.h"
#include "dhcpv6.h"
+static const char *excluded_class = "HOMENET";
+
static void relay_client_request(struct sockaddr_in6 *source,
const void *data, size_t len, struct interface *iface);
uint16_t duid_type;
uint16_t hardware_type;
uint8_t mac[6];
+ uint16_t solmaxrt_type;
+ uint16_t solmaxrt_length;
+ uint32_t solmaxrt_value;
uint16_t clientid_type;
uint16_t clientid_length;
uint8_t clientid_buf[130];
.serverid_length = htons(10),
.duid_type = htons(3),
.hardware_type = htons(1),
+ .solmaxrt_type = htons(DHCPV6_OPT_SOL_MAX_RT),
+ .solmaxrt_length = htons(4),
+ .solmaxrt_value = htonl(60),
.clientid_type = htons(DHCPV6_OPT_CLIENTID),
.clientid_buf = {0}
};
if (olen != ntohs(dest.serverid_length) ||
memcmp(odata, &dest.duid_type, olen))
return; // Not for us
+ } else if (otype == DHCPV6_OPT_USER_CLASS) {
+ uint8_t *c = odata, *cend = &odata[olen];
+ for (; &c[2] <= cend && &c[2 + (c[0] << 8) + c[1]] <= cend; c = &c[2 + (c[0] << 8) + c[1]]) {
+ size_t elen = strlen(excluded_class);
+ if (((((size_t)c[0]) << 8) | c[1]) == elen && !memcmp(&c[2], excluded_class, elen))
+ return; // Ignore from homenet
+ }
}
}