}
#endif
- dhcp_handlebootp(ifp, (struct bootp *)iov->iov_base, iov->iov_len,
+ dhcp_handlebootp(ifp, iov->iov_base, iov->iov_len,
&from->sin_addr);
}
{
const struct dhcp_state *state;
struct sockaddr_in from;
- unsigned char buf[10 * 1024]; /* Maximum MTU */
+ union {
+ struct bootp bootp;
+ uint8_t buf[10 * 1024]; /* Maximum MTU */
+ } iovbuf;
struct iovec iov = {
- .iov_base = buf,
- .iov_len = sizeof(buf),
+ .iov_base = iovbuf.buf,
+ .iov_len = sizeof(iovbuf.buf),
};
union {
struct cmsghdr hdr;
struct msghdr msg = {
.msg_name = &from, .msg_namelen = sizeof(from),
.msg_iov = &iov, .msg_iovlen = 1,
- .msg_control = buf, .msg_controllen = sizeof(cmsgbuf.buf),
+ .msg_control = cmsgbuf.buf, .msg_controllen = sizeof(cmsgbuf.buf),
};
int s;
ssize_t bytes;
dhcp6_recv(struct dhcpcd_ctx *ctx, struct ipv6_addr *ia)
{
struct sockaddr_in6 from;
- unsigned char buf[64 * 1024]; /* Maximum UDP message size */
+ union {
+ struct dhcp6_message dhcp6;
+ uint8_t buf[64 * 1024]; /* Maximum UDP message size */
+ } iovbuf;
struct iovec iov = {
- .iov_base = buf,
- .iov_len = sizeof(buf),
+ .iov_base = iovbuf.buf, .iov_len = sizeof(iovbuf.buf),
};
union {
struct cmsghdr hdr;
struct dhcpcd_ctx *ctx;
int fd;
struct sockaddr_in6 from;
- unsigned char buf[64 * 1024]; /* Maximum ICMPv6 size */
+ union {
+ struct icmp6_hdr hdr;
+ uint8_t buf[64 * 1024]; /* Maximum ICMPv6 size */
+ } iovbuf;
struct iovec iov = {
- .iov_base = buf,
- .iov_len = sizeof(buf),
+ .iov_base = iovbuf.buf, .iov_len = sizeof(iovbuf.buf),
};
union {
struct cmsghdr hdr;