X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=proto.c;h=91219189437dd4b9feb0671e23085bdf964f58cf;hp=d5e99bf3b5298878a23eb77efa5604f42b79ab7b;hb=121d90a6faa4a689a593eadb738e537a5768534d;hpb=d095bf24cf7879150d008c23998676bfedebbde6 diff --git a/proto.c b/proto.c index d5e99bf..9121918 100644 --- a/proto.c +++ b/proto.c @@ -69,6 +69,7 @@ enum { ADDR_PREFERRED, ADDR_VALID, ADDR_OFFLINK, + ADDR_CLASS, __ADDR_MAX }; @@ -80,6 +81,7 @@ static const struct blobmsg_policy proto_ip_addr[__ADDR_MAX] = { [ADDR_PREFERRED] = { .name = "preferred", .type = BLOBMSG_TYPE_INT32 }, [ADDR_VALID] = { .name = "valid", .type = BLOBMSG_TYPE_INT32 }, [ADDR_OFFLINK] = { .name = "offlink", .type = BLOBMSG_TYPE_BOOL }, + [ADDR_CLASS] = { .name = "class", .type = BLOBMSG_TYPE_STRING }, }; static struct device_addr * @@ -208,6 +210,9 @@ parse_address_item(struct blob_attr *attr, bool v6, bool ext) else if (addr->preferred_until > addr->valid_until) goto error; } + + if ((cur = tb[ADDR_CLASS])) + addr->pclass = strdup(blobmsg_get_string(cur)); } return addr;