Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/dhcpcd/dist/src Try to fix build of dhcpcd (bpf...



details:   https://anonhg.NetBSD.org/src/rev/1e018dc146a1
branches:  trunk
changeset: 352473:1e018dc146a1
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon Apr 03 00:42:20 2017 +0000

description:
Try to fix build of dhcpcd (bpf.c) - violation of stack protector (GCC)

Patch obtained from <roy>

diffstat:

 external/bsd/dhcpcd/dist/src/bpf.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r a8c4784dc6ad -r 1e018dc146a1 external/bsd/dhcpcd/dist/src/bpf.c
--- a/external/bsd/dhcpcd/dist/src/bpf.c        Mon Apr 03 00:11:45 2017 +0000
+++ b/external/bsd/dhcpcd/dist/src/bpf.c        Mon Apr 03 00:42:20 2017 +0000
@@ -419,13 +419,13 @@
        BPF_STMT(BPF_RET + BPF_K, 0),
 };
 #define bpf_arp_filter_len     __arraycount(bpf_arp_filter)
-#define bpf_arp_extra          (((ARP_ADDRS_MAX + 1) * 2) * 2) + 2
+#define bpf_arp_extra          ((((ARP_ADDRS_MAX + 1) * 2) * 2) + 2)
+#define bpf_arp_hw             ((((HWADDR_LEN / 4) + 2) * 2) + 1)
 
 int
 bpf_arp(struct interface *ifp, int fd)
 {
-       size_t bpf_hw = (((sizeof(ifp->hwaddr) / 4) + 2) * 2) + 1;
-       struct bpf_insn bpf[3 + bpf_arp_filter_len + bpf_hw + bpf_arp_extra];
+       struct bpf_insn bpf[3+ bpf_arp_filter_len + bpf_arp_hw + bpf_arp_extra];
        struct bpf_insn *bp;
        struct iarp_state *state;
 
@@ -449,7 +449,7 @@
        bp += bpf_arp_filter_len;
 
        /* Ensure it's not from us. */
-       bp += bpf_cmp_hwaddr(bp, bpf_hw, sizeof(struct arphdr),
+       bp += bpf_cmp_hwaddr(bp, bpf_arp_hw, sizeof(struct arphdr),
                             false, ifp->hwaddr, ifp->hwlen);
 
        state = ARP_STATE(ifp);



Home | Main Index | Thread Index | Old Index