X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv6.c;h=aaefa5e4126764f30cf0636a7c94bcfad08c4688;hp=37dc3f5057a1b5f9d3d8ae3a3c61ae58a8c08328;hb=4f4de590ce3bf6f44a6783559479f5055571fe44;hpb=87b974a21add279ce7f7be31f7b22f7ea97949c3 diff --git a/src/dhcpv6.c b/src/dhcpv6.c index 37dc3f5..aaefa5e 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -22,8 +22,6 @@ #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); @@ -293,11 +291,11 @@ static void handle_client_request(void *addr, void *data, size_t len, if (olen != ntohs(dest.serverid_length) || memcmp(odata, &dest.duid_type, olen)) return; // Not for us - } else if (otype == DHCPV6_OPT_USER_CLASS) { + } else if (iface->filter_class && 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)) + size_t elen = strlen(iface->filter_class); + if (((((size_t)c[0]) << 8) | c[1]) == elen && !memcmp(&c[2], iface->filter_class, elen)) return; // Ignore from homenet } } else if (otype == DHCPV6_OPT_IA_PD) {