Module Name:    src
Committed By:   kamil
Date:           Mon Apr  3 00:42:20 UTC 2017

Modified Files:
        src/external/bsd/dhcpcd/dist/src: bpf.c

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

Patch obtained from <roy>


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/dhcpcd/dist/src/bpf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/bpf.c
diff -u src/external/bsd/dhcpcd/dist/src/bpf.c:1.1.1.2 src/external/bsd/dhcpcd/dist/src/bpf.c:1.2
--- src/external/bsd/dhcpcd/dist/src/bpf.c:1.1.1.2	Sun Apr  2 18:54:20 2017
+++ src/external/bsd/dhcpcd/dist/src/bpf.c	Mon Apr  3 00:42:20 2017
@@ -419,13 +419,13 @@ static const struct bpf_insn bpf_arp_fil
 	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 @@ bpf_arp(struct interface *ifp, int fd)
 	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);

Reply via email to