summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/dhclient/dhclient.c3
-rw-r--r--sbin/dhclient/dispatch.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 038b74dfed6..b1820157647 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.179 2012/11/23 15:25:47 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.180 2012/11/24 18:06:14 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -666,6 +666,7 @@ bind_lease(void)
lease = apply_defaults(client->new);
options = lease->options;
+ memset(&mask, 0, sizeof(mask));
memcpy(&mask.s_addr, options[DHO_SUBNET_MASK].data,
options[DHO_SUBNET_MASK].len);
add_address(ifi->name, ifi->rdomain, client->new->address, mask);
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index cd73f79d7d1..81e73313717 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.66 2012/11/23 15:25:47 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.67 2012/11/24 18:06:14 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -358,8 +358,9 @@ subnet_exists(struct client_lease *l)
struct in_addr mymask, myaddr, mynet, hismask, hisaddr, hisnet;
int myrdomain, hisrdomain;
+ memset(&mymask, 0, sizeof(mymask));
memcpy(&mymask.s_addr, l->options[DHO_SUBNET_MASK].data,
- sizeof(in_addr_t));
+ l->options[DHO_SUBNET_MASK].len);
myaddr.s_addr = l->address.s_addr;
mynet.s_addr = mymask.s_addr & myaddr.s_addr;