summaryrefslogtreecommitdiff
path: root/usr.sbin/dhcpd
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2013-04-12 00:27:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2013-04-12 00:27:33 +0000
commitd18ef235fa72fd98c739522afa90dc3f14825236 (patch)
treee37be8361dcf6f678f4fd461202efd6b16042c19 /usr.sbin/dhcpd
parent540fde069a25c41046c96a3c6ff6569e1c909814 (diff)
Unbreak lease synchronization by making the sync header contain the
correct packet length even when paddding is present. Previously the HMAC calculated by the receiver would not be based on the whole packet. Problem noted and essentially identical diffs from Kapetanakis Giannis via misc@ and then Johan Ymerson via bugs@.
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r--usr.sbin/dhcpd/sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/sync.c b/usr.sbin/dhcpd/sync.c
index 546d95f25b4..aebf6232b85 100644
--- a/usr.sbin/dhcpd/sync.c
+++ b/usr.sbin/dhcpd/sync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sync.c,v 1.10 2010/12/23 17:38:04 claudio Exp $ */
+/* $OpenBSD: sync.c,v 1.11 2013/04/12 00:27:32 krw Exp $ */
/*
* Copyright (c) 2008 Bob Beck <beck@openbsd.org>
@@ -426,7 +426,7 @@ sync_lease(struct lease *lease)
hdr.sh_version = DHCP_SYNC_VERSION;
hdr.sh_af = AF_INET;
hdr.sh_counter = sync_counter++;
- hdr.sh_length = htons(sizeof(hdr) + sizeof(ld) + sizeof(end));
+ hdr.sh_length = htons(sizeof(hdr) + sizeof(ld) + padlen + sizeof(end));
iov[i].iov_base = &hdr;
iov[i].iov_len = sizeof(hdr);
HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len);