diff options
author | Vinay Kulkarni <vskibum@gmail.com> | 2016-03-09 21:58:44 -0800 |
---|---|---|
committer | Vinay Kulkarni <vskibum@gmail.com> | 2016-03-09 21:58:44 -0800 |
commit | c83321e6d40b294e73e2881e4a98172c4244323b (patch) | |
tree | 631e97f505c07f8ece1141e2cac66dbc1fe52cd3 /src/libsystemd-network/network-internal.c | |
parent | bd7e03af007c4e857ed0370eba9e903d6b561937 (diff) |
DHCP DUID and IAID configurability
Diffstat (limited to 'src/libsystemd-network/network-internal.c')
-rw-r--r-- | src/libsystemd-network/network-internal.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c index cb7252bbeb..7c21f42591 100644 --- a/src/libsystemd-network/network-internal.c +++ b/src/libsystemd-network/network-internal.c @@ -335,6 +335,34 @@ int config_parse_hwaddr(const char *unit, return 0; } +int config_parse_iaid_value(const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata) { + uint32_t iaid_value; + int r; + + assert(filename); + assert(lvalue); + assert(rvalue); + assert(data); + + if ((r = safe_atou32(rvalue, &iaid_value)) < 0) { + log_syntax(unit, LOG_ERR, filename, line, 0, "Unable to read IAID: %s", rvalue); + return r; + } + + *((be32_t *)data) = htobe32(iaid_value); + + return 0; +} + void serialize_in_addrs(FILE *f, const struct in_addr *addresses, size_t size) { unsigned i; |