aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/dhcp/client.h
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-10-15 15:47:55 +0000
committerNeale Ranns <nranns@cisco.com>2019-10-25 17:56:06 +0000
commit6bcc6a45573f387fa6c1682069da7ee9036cabe2 (patch)
tree2471089b417624c5eeda998db113edeb5b4b5c95 /src/plugins/dhcp/client.h
parentd7b306657d205fddd781e982aec5f3c3dc69fa88 (diff)
dhcp: fix crash on unicast renewal send
Type: fix - when the addresses were learnt a copy of the client was sent to the main thread, this meant the unicast adjacecny was saved on the copy not on the original. - Add logging. - Improve the proxy-node that hands the clint packets so the DHCP packets are traced. - allow a renewal to configure new address data Change-Id: I6ab0afcccbc4a1cdefdd1b8beeda8fc7ba20ec1f Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/plugins/dhcp/client.h')
-rw-r--r--src/plugins/dhcp/client.h33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/plugins/dhcp/client.h b/src/plugins/dhcp/client.h
index 68176abadf6..e9e3bcf67c4 100644
--- a/src/plugins/dhcp/client.h
+++ b/src/plugins/dhcp/client.h
@@ -42,6 +42,24 @@ struct dhcp_client_t_;
typedef void (*dhcp_event_cb_t) (u32 client_index,
const struct dhcp_client_t_ * client);
+/**
+ * The set of addresses/mask that contribute forwarding info
+ * and are installed.
+ */
+typedef struct dhcp_client_fwd_addresses_t_
+{
+ /** the address assigned to this client and it's mask */
+ ip4_address_t leased_address;
+ u32 subnet_mask_width;
+
+ /** the address of the DHCP server handing out the address.
+ this is used to send any unicast messages */
+ ip4_address_t dhcp_server;
+
+ /** The address of this client's default gateway - may not be present */
+ ip4_address_t router_address;
+} dhcp_client_fwd_addresses_t;
+
typedef struct dhcp_client_t_
{
dhcp_client_state_t state;
@@ -59,11 +77,16 @@ typedef struct dhcp_client_t_
/* DHCP transaction ID, a random number */
u32 transaction_id;
- /* leased address, other learned info DHCP */
- ip4_address_t leased_address; /* from your_ip_address field */
- ip4_address_t dhcp_server;
- u32 subnet_mask_width; /* option 1 */
- ip4_address_t router_address; /* option 3 */
+ /**
+ * leased address, other learned info DHCP
+ * the learned set is updated by new messages recieved in the DP
+ * the installed set is what's actually been added
+ */
+ dhcp_client_fwd_addresses_t learned;
+ dhcp_client_fwd_addresses_t installed;
+ /* have local Addresses and default route been installed */
+ u8 addresses_installed;
+
ip4_address_t *domain_server_address; /* option 6 */
u32 lease_renewal_interval; /* option 51 */
u32 lease_lifetime; /* option 59 */