Damien Zammit, le dim. 20 juil. 2025 02:49:16 +0000, a ecrit:
> + flag = 0;
> + err = rump_sys_ioctl (nd->bpf_fd, BIOCIMMEDIATE, &flag);
> + if (err < 0)
> + {
> + mach_print("ERROR: biocimmediate failed\n");
> + errno = rump_errno2host(err);
> + return errno;
> + }
> +
> + /* We need this timeout for blocking requests to flush even if not full */
> + err = rump_sys_ioctl (nd->bpf_fd, BIOCSRTIMEOUT, &timeout);
? Is that not BIOCIMMEDIATE that achieves this? You are talking about
incomming packets, right? rarpd for instance only uses BIOCIMMEDIATE,
not BIOCSRTIMEOUT.
> +static io_return_t
> +send_packet (struct net_data *nd, io_buf_ptr_t buf, unsigned int bytes)
> +{
> + io_return_t err;
> + struct ethhdr *hdr = (struct ethhdr *)buf;
I don't think you need the cast?
> + struct iovec iov;
> + int result;
> + int flag;
> + int i;
> +
> + iov.iov_base = hdr;
> + iov.iov_len = bytes;
> +
> + result = rump_sys_writev (nd->bpf_fd, &iov, 1);
> + if (result < 0)
> + {
Samuel