summaryrefslogtreecommitdiff
path: root/proto.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2013-05-30 16:32:00 +0200
committerSteven Barth <steven@midlink.org>2013-05-30 16:32:00 +0200
commitda279866a33682e590428b740b4564a4b2e6f780 (patch)
treee14e9dd8afd24a635eb2c1e924b4b910b33d2e9d /proto.c
parent91228b6efb36c8954e3d23c0801f54ee984d5a0a (diff)
downloadnetifd-da279866a33682e590428b740b4564a4b2e6f780.tar.gz
IPv6: reorganize prefix assignment
* put parameters in a more suitable place * add support for prefix classes
Diffstat (limited to 'proto.c')
-rw-r--r--proto.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/proto.c b/proto.c
index d060d2e..1850e54 100644
--- a/proto.c
+++ b/proto.c
@@ -285,6 +285,7 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len)
char *prefstr = strtok_r(NULL, ",", &saveptr);
char *validstr = (!prefstr) ? NULL : strtok_r(NULL, ",", &saveptr);
char *addstr = (!validstr) ? NULL : strtok_r(NULL, ",", &saveptr);
+ const char *pclass = NULL;
int64_t pref = (!prefstr) ? 0 : strtoul(prefstr, NULL, 10);
int64_t valid = (!validstr) ? 0 : strtoul(validstr, NULL, 10);
@@ -315,6 +316,8 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len)
return false;
excludedp = &excluded;
+ } else if (!strcmp(key, "class")) {
+ pclass = val;
}
}
@@ -333,7 +336,7 @@ parse_prefix_option(struct interface *iface, const char *str, size_t len)
interface_ip_add_device_prefix(iface, &addr, length,
valid_until, preferred_until,
- excludedp, excl_length);
+ excludedp, excl_length, pclass);
return true;
}