summaryrefslogtreecommitdiff
path: root/networking/udhcp/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/udhcp/packet.c')
-rw-r--r--networking/udhcp/packet.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/networking/udhcp/packet.c b/networking/udhcp/packet.c
index 272e79d..41cd321 100644
--- a/networking/udhcp/packet.c
+++ b/networking/udhcp/packet.c
@@ -194,17 +194,14 @@ int udhcp_kernel_packet(struct dhcpMessage *payload,
if (fd < 0)
return -1;
- if (setsockopt_reuseaddr(fd) == -1) {
- close(fd);
- return -1;
- }
+ setsockopt_reuseaddr(fd);
memset(&client, 0, sizeof(client));
client.sin_family = AF_INET;
client.sin_port = htons(source_port);
client.sin_addr.s_addr = source_ip;
- if (bind(fd, (struct sockaddr *)&client, sizeof(struct sockaddr)) == -1) {
+ if (bind(fd, (struct sockaddr *)&client, sizeof(client)) == -1) {
close(fd);
return -1;
}