summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-02-06 18:19:46 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-02-06 18:19:46 +0000
commit2de6d40940af3a782f47c890f51556a7e2e09bf5 (patch)
tree7f316d2df33e952559a196f5618f92b0d3e86337
parent3bb613b104891cf914820f63a7bad96bfc1ddb66 (diff)
Don't pass long*'s to ioctl's expecting int*'s (part 1 of a 2 part fix for
sparc64 dhcpd)
-rw-r--r--usr.sbin/dhcp/common/bpf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/dhcp/common/bpf.c b/usr.sbin/dhcp/common/bpf.c
index 2509299291d..bf0321ccad4 100644
--- a/usr.sbin/dhcp/common/bpf.c
+++ b/usr.sbin/dhcp/common/bpf.c
@@ -171,7 +171,7 @@ int dhcp_bpf_tr_filter_len = (sizeof dhcp_bpf_tr_filter /
void if_register_receive (info)
struct interface_info *info;
{
- int flag = 1;
+ int flag = 1, sz;
struct bpf_version v;
struct bpf_program p;
@@ -193,8 +193,9 @@ void if_register_receive (info)
error ("Can't set immediate mode on bpf device: %m");
/* Get the required BPF buffer length from the kernel. */
- if (ioctl (info -> rfdesc, BIOCGBLEN, &info -> rbuf_max) < 0)
+ if (ioctl (info -> rfdesc, BIOCGBLEN, &sz) < 0)
error ("Can't get bpf buffer length: %m");
+ info->rbuf_max = sz;
info -> rbuf = malloc (info -> rbuf_max);
if (!info -> rbuf)
error ("Can't allocate %d bytes for bpf input buffer.");