summaryrefslogtreecommitdiff
path: root/proto.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-11-27 14:52:31 +0100
committerSteven Barth <steven@midlink.org>2013-11-27 14:52:31 +0100
commit5e43781680f9f55e0ae7c1b681465d64882e3b8c (patch)
tree334324e04d2b4f308690aebdfc68dcae7f3be531 /proto.c
parent199723ed921160c029a0d15fa95914ddfcdc5cb9 (diff)
downloadnetifd-5e43781680f9f55e0ae7c1b681465d64882e3b8c.tar.gz
IPv6: add class support to regular IPv6 addresses
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c5
1 files changed, 5 insertions, 0 deletions
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;