]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Don't use a variable length buffer.
authorRoy Marples <roy@marples.name>
Sun, 2 Apr 2017 10:09:16 +0000 (11:09 +0100)
committerRoy Marples <roy@marples.name>
Sun, 2 Apr 2017 10:09:16 +0000 (11:09 +0100)
src/bpf.c

index b89f7d8212485ae0904a28b74d6a5018fc924e9d..0da4ecad1cfdd5a2b731ae2a0ef645dbad26d444 100644 (file)
--- a/src/bpf.c
+++ b/src/bpf.c
@@ -424,7 +424,7 @@ static const struct bpf_insn bpf_arp_filter [] = {
 int
 bpf_arp(struct interface *ifp, int fd)
 {
-       size_t bpf_hw = ((((size_t)ifp->hwlen / 4) + 2) * 2) + 1;
+       size_t bpf_hw = (((sizeof(ifp->hwlen) / 4) + 2) * 2) + 1;
        struct bpf_insn bpf[3 + bpf_arp_filter_len + bpf_hw + bpf_arp_extra];
        struct bpf_insn *bp;
        struct iarp_state *state;