Fix memcpy

This commit is contained in:
Vadim Vetrov
2024-09-19 22:28:32 +03:00
parent 5415bc37ec
commit 2fd3107401
3 changed files with 7 additions and 18 deletions

View File

@@ -65,16 +65,8 @@ static int send_raw_ipv4(const uint8_t *pkt, uint32_t pktlen) {
memset(&msg, 0, sizeof(msg));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov.iov_base = (__u8 *)pkt;
iov.iov_len = pktlen;
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, 1);
#else
iov.iov_base = (__u8 *)pkt;
iov.iov_len = pktlen;
// msg.msg_iov = (struct iovec *)&iov;
// msg.msg_iovlen = iov.iov_len;
#endif
msg.msg_flags = 0;
msg.msg_name = &daddr;
@@ -133,16 +125,8 @@ int send_raw_ipv6(const uint8_t *pkt, uint32_t pktlen) {
struct msghdr msg;
memset(&msg, 0, sizeof(msg));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
iov.iov_base = (__u8 *)pkt;
iov.iov_len = pktlen;
iov_iter_kvec(&msg.msg_iter, READ, &iov, 1, 1);
#else
iov.iov_base = (__u8 *)pkt;
iov.iov_len = pktlen;
// msg.msg_iov = (struct iovec *)&iov;
// msg.msg_iovlen = iov.iov_len;
#endif
msg.msg_flags = 0;
msg.msg_name = &daddr;