diff options
author | Steven Barth <steven@midlink.org> | 2013-11-27 14:52:31 +0100 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2013-11-27 14:52:31 +0100 |
commit | 5e43781680f9f55e0ae7c1b681465d64882e3b8c (patch) | |
tree | 334324e04d2b4f308690aebdfc68dcae7f3be531 /proto.c | |
parent | 199723ed921160c029a0d15fa95914ddfcdc5cb9 (diff) |
IPv6: add class support to regular IPv6 addresses
Diffstat (limited to 'proto.c')
-rw-r--r-- | proto.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |