diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-07-14 22:46:55 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2021-08-14 21:11:30 +0200 |
commit | 16667699228101fda936068e3d11c0cf19270e34 (patch) | |
tree | 48cf08135c5286bb45c8c5f3606b92208f811fdc /src/odhcpd.h | |
parent | bc9d317f2921ae6b529f2c9f8de79b75992e206f (diff) |
dhcpv6-ia: allow up to 64 bit wide hostid
Add dhcpv6_hostid_len config option which controls the number
of bits in the host identifier of dynamically assigned IPv6
addresses. The default is 12 bits which is also the minimum.
The maximum is the whole interface identifier, i.e. 64 bits.
Allow up to 64 bit wide hostid in static leases.
Fixes #84 and #27.
Signed-off-by: Mikael Magnusson <mikma@users.sourceforge.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/odhcpd.h')
-rw-r--r-- | src/odhcpd.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/odhcpd.h b/src/odhcpd.h index ee7b008..ff7e105 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -156,7 +156,7 @@ struct lease { struct vlist_node node; struct list_head assignments; uint32_t ipaddr; - uint32_t hostid; + uint64_t hostid; struct ether_addr mac; uint16_t duid_len; uint8_t *duid; @@ -199,7 +199,10 @@ struct dhcp_assignment { struct odhcpd_ref_ip *fr_ip; uint32_t addr; - uint32_t assigned; + union { + uint64_t assigned_host_id; + uint32_t assigned_subnet_id; + }; uint32_t iaid; uint8_t length; // length == 128 -> IA_NA, length <= 64 -> IA_PD @@ -323,6 +326,7 @@ struct interface { bool dhcpv6_assignall; bool dhcpv6_pd; bool dhcpv6_na; + uint32_t dhcpv6_hostid_len; char *upstream; size_t upstream_len; @@ -390,7 +394,7 @@ bool odhcpd_valid_hostname(const char *name); int config_parse_interface(void *data, size_t len, const char *iname, bool overwrite); struct lease *config_find_lease_by_duid(const uint8_t *duid, const uint16_t len); struct lease *config_find_lease_by_mac(const uint8_t *mac); -struct lease *config_find_lease_by_hostid(const uint32_t hostid); +struct lease *config_find_lease_by_hostid(const uint64_t hostid); struct lease *config_find_lease_by_ipaddr(const uint32_t ipaddr); int set_lease_from_blobmsg(struct blob_attr *ba); |