Module Name: src Committed By: roy Date: Mon Dec 18 16:03:26 UTC 2023
Modified Files: src/external/bsd/dhcpcd/dist/src: bpf.c Log Message: Fix import To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 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.21 src/external/bsd/dhcpcd/dist/src/bpf.c:1.22 --- src/external/bsd/dhcpcd/dist/src/bpf.c:1.21 Mon Dec 18 15:51:28 2023 +++ src/external/bsd/dhcpcd/dist/src/bpf.c Mon Dec 18 16:03:26 2023 @@ -41,7 +41,6 @@ #define bpf_insn sock_filter #else #include <net/bpf.h> -#include <net/if_vlanvar.h> #endif #include <errno.h> @@ -316,34 +315,17 @@ ssize_t bpf_send(const struct bpf *bpf, uint16_t protocol, const void *data, size_t len) { - struct iovec iov[3]; + struct iovec iov[2]; struct ether_header eh; - struct ether_vlan_header evh; - const struct interface *ifp = bpf->bpf_ifp; - switch(ifp->hwtype) { + switch(bpf->bpf_ifp->hwtype) { case ARPHRD_ETHER: -#ifdef BSD - loginfox("%d", ifp->vlanid); - if (ifp->vlanid) { - memset(&evh.evl_dhost, 0xff, sizeof(evh.evl_dhost)); - memcpy(&evh.evl_shost, ifp->hwaddr, - sizeof(evh.evl_shost)); - evh.evl_proto = htons(protocol); - evh.evl_encap_proto = htons(ETHERTYPE_VLAN); - evh.evl_tag = htons(ifp->vlanid); - iov[0].iov_base = &evh; - iov[0].iov_len = sizeof(evh); - } else -#endif - { - memset(&eh.ether_dhost, 0xff, sizeof(eh.ether_dhost)); - memcpy(&eh.ether_shost, ifp->hwaddr, - sizeof(eh.ether_shost)); - eh.ether_type = htons(protocol); - iov[0].iov_base = &eh; - iov[0].iov_len = sizeof(eh); - } + memset(&eh.ether_dhost, 0xff, sizeof(eh.ether_dhost)); + memcpy(&eh.ether_shost, bpf->bpf_ifp->hwaddr, + sizeof(eh.ether_shost)); + eh.ether_type = htons(protocol); + iov[0].iov_base = &eh; + iov[0].iov_len = sizeof(eh); break; default: iov[0].iov_base = NULL; @@ -712,7 +694,7 @@ int bpf_bootp(const struct bpf *bpf, __unused const struct in_addr *ia) { -#ifdef BIOCSETWFx +#ifdef BIOCSETWF if (bpf_bootp_rw(bpf, true) == -1 || bpf_bootp_rw(bpf, false) == -1 || ioctl(bpf->bpf_fd, BIOCLOCK) == -1)