diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2017-07-03 16:39:21 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2017-08-07 15:27:20 +0200 |
commit | 95d0fb6c25944985b9717a51cebaa7ea8dc7222d (patch) | |
tree | 511a3d34366f148043a1920bf54b414ed7962199 /src/odhcpd.h | |
parent | 296b4a0ddd7d6d77e48ee36f3407b0769caaa0d7 (diff) |
treewide: rework IPv4 address logic
Align IPv4 address logic with IPv6 by caching per interface the assigned
IPv4 addresses. This allows to get rid of different ioctl calls in the
DHCPv4 logic to retrieve the IPv4 address and netmask in use by an
interface.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/odhcpd.h')
-rw-r--r-- | src/odhcpd.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/odhcpd.h b/src/odhcpd.h index a03baf0..b0801a4 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -76,11 +76,14 @@ union if_addr { struct odhcpd_ipaddr { union if_addr addr; uint8_t prefix; + uint32_t preferred; + uint32_t valid; /* ipv6 only */ uint8_t dprefix; - uint32_t preferred; - uint32_t valid; + + /* ipv4 only */ + struct in_addr broadcast; }; enum odhcpd_mode { @@ -127,6 +130,8 @@ struct interface { // Runtime data struct uloop_timeout timer_rs; struct list_head ia_assignments; + struct odhcpd_ipaddr *addr4; + size_t addr4_len; struct odhcpd_ipaddr *ia_addr; size_t ia_addr_len; |