From 9ef243469aa5b55a79474d77a3a03f0cf333c24f Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Fri, 8 May 2026 00:03:48 +0400 Subject: [PATCH] packet: rename shared UDP checksum helper --- packet/construct_unix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packet/construct_unix.c b/packet/construct_unix.c index f86fd52..29cac31 100644 --- a/packet/construct_unix.c +++ b/packet/construct_unix.c @@ -175,8 +175,8 @@ void set_udp_ports( /* Prepend pseudoheader to the udp datagram and calculate checksum */ static -int udp4_checksum(void *pheader, void *udata, int psize, int dsize, - int alt_checksum) +int udp_checksum(void *pheader, void *udata, int psize, int dsize, + int alt_checksum) { unsigned int totalsize = psize + dsize; unsigned char csumpacket[totalsize]; @@ -234,7 +234,7 @@ int construct_udp4_packet( udp_size + sizeof(struct UDPHeader)]; } - *checksum_off = htons(udp4_checksum(&udph, udp, + *checksum_off = htons(udp_checksum(&udph, udp, sizeof(struct UDPPseudoHeader), udp_size, udp->checksum != 0)); @@ -277,7 +277,7 @@ int construct_udp6_packet( checksum_off is udp payload */ checksum_off = (uint16_t *)&packet_buffer[sizeof(struct UDPHeader)]; } - *checksum_off = htons(udp4_checksum(&udph, udp, + *checksum_off = htons(udp_checksum(&udph, udp, sizeof(struct IP6PseudoHeader), udp_size, udp->checksum != 0)); return 0; -- 2.47.3