- l = script_unhexlify(buf, sizeof(buf), optarg);
- if (l) {
- if (odhcp6c_add_state(STATE_VENDORCLASS, buf, l)) {
- syslog(LOG_ERR, "Failed to set vendor-class option");
- return 1;
+ opt = odhcp6c_find_opt(DHCPV6_OPT_VENDOR_CLASS);
+ if (!opt) {
+ syslog(LOG_ERR, "Failed to set vendor-class option");
+ return 1;
+ }
+
+ o_data = NULL;
+ res = parse_opt_data(optarg, &o_data, opt->flags & OPT_MASK_SIZE,
+ (opt->flags & OPT_ARRAY) == OPT_ARRAY);
+ if (res > 0) {
+ res = add_opt(opt->code, o_data, res);
+ if (res) {
+ if (res > 0)
+ return 1;
+
+ help = true;