AF_XDP-interaction: Fix pointer to UDP data area for memset

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This commit is contained in:
Jesper Dangaard Brouer
2021-12-03 23:12:20 +01:00
parent 1e8ad22fe0
commit 709607bfdd

View File

@@ -591,19 +591,10 @@ static void gen_udp_hdr(struct udphdr *udp_hdr, struct iphdr *ip_hdr)
udp_hdr->len = htons(UDP_PKT_SIZE);
/* UDP data */
memset32_htonl(udp_hdr + sizeof(struct udphdr),
memset32_htonl((void*)udp_hdr + sizeof(struct udphdr),
opt_pkt_fill_pattern,
UDP_PKT_DATA_SIZE);
if (0) {
uint8_t *p = udp_hdr + sizeof(struct udphdr);
int i;
for (i = 0; i < UDP_PKT_DATA_SIZE; i++) {
printf("i[%d] = %c\n", i, p[i]);
}
}
/* UDP header checksum */
udp_hdr->check = 0;
udp_hdr->check = udp_csum(ip_hdr->saddr, ip_hdr->daddr, UDP_PKT_SIZE,