From f596e0fce394829109bffafa9d14dcbbf8dbde61 Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 3 Jul 2017 22:06:11 +0000 Subject: [PATCH] sizeof(struct sockaddr_in) != sizeof(struct in_addr). Fix construction of the unicast UDP packets being sent out via sendmsg(). Accidentally broken in r1.32 (5.6) when types were juggled. ok bluhm@ --- sbin/dhclient/bpf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/dhclient/bpf.c b/sbin/dhclient/bpf.c index e5f8fc92bd4..d3d6761ffad 100644 --- a/sbin/dhclient/bpf.c +++ b/sbin/dhclient/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.54 2017/06/27 15:56:15 krw Exp $ */ +/* $OpenBSD: bpf.c,v 1.55 2017/07/03 22:06:11 krw Exp $ */ /* BPF socket interface code, originally contributed by Archie Cobbs. */ @@ -316,7 +316,7 @@ send_packet(struct interface_info *ifi, struct in_addr from, struct in_addr to) } else { memset(&msg, 0, sizeof(msg)); msg.msg_name = (struct sockaddr *)&dest; - msg.msg_namelen = sizeof(to); + msg.msg_namelen = sizeof(dest); msg.msg_iov = iov; msg.msg_iovlen = iovcnt; result = sendmsg(ifi->ufdesc, &msg, 0); -- 2.20.1