Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add end option to be rfc compliant #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/dhcpdiscover.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ typedef struct requested_server_struct {
#define DHCP_OPTION_LEASE_TIME 51
#define DHCP_OPTION_RENEWAL_TIME 58
#define DHCP_OPTION_REBINDING_TIME 59
#define DHCP_OPTION_END 255

#define DHCP_INFINITE_TIME 0xFFFFFFFF

Expand Down Expand Up @@ -503,6 +504,9 @@ int send_dhcp_discover(int sock)
discover_packet.options[7] = DHCP_OPTION_REQUESTED_ADDRESS;
discover_packet.options[8] = '\x04';
memcpy(&discover_packet.options[9], &requested_address, sizeof(requested_address));
discover_packet.options[10] = DHCP_OPTION_END;
} else {
discover_packet.options[7] = DHCP_OPTION_END;
}

/* send the DHCPDISCOVER packet to broadcast address */
Expand Down