Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning #490

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions packet/construct_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ 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 udp_checksum(void *pheader, void *udata, int psize, int dsize,
int alt_checksum)
{
unsigned int totalsize = psize + dsize;
Expand Down Expand Up @@ -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));

Expand All @@ -244,13 +244,11 @@ int construct_udp4_packet(
/* Construct a header for UDPv6 probes */
static
int construct_udp6_packet(
const struct net_state_t *net_state,
struct probe_t *probe,
char *packet_buffer,
int packet_size,
const struct probe_param_t *param)
{
int udp_socket = net_state->platform.udp6_send_socket;
struct UDPHeader *udp;
int udp_size;

Expand Down Expand Up @@ -278,7 +276,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;
Expand Down Expand Up @@ -782,7 +780,7 @@ int construct_ip6_packet(
}

if (construct_udp6_packet
(net_state, probe, packet_buffer, packet_size, param)) {
(probe, packet_buffer, packet_size, param)) {
return -1;
}
} else {
Expand Down