diff options
Diffstat (limited to 'src/icmp.c')
-rw-r--r-- | src/icmp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,10 +1,12 @@ +#include <time.h> #include <errno.h> #include <netdb.h> #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <unistd.h> -#include <asm/types.h> +#include <sys/types.h> #include <arpa/inet.h> #include <netinet/ip.h> #include <netinet/ip_icmp.h> @@ -13,7 +15,6 @@ static char *pr_addr(__u32 addr) { - struct hostent *hp; static char buf[4096]; sprintf(buf, "%s", inet_ntoa(*(struct in_addr *)&addr)); @@ -300,10 +301,9 @@ int icmp_send_ping(int fd, struct sockaddr *to, int tolen, return icmp_send(fd, to, tolen, (void *) packet, len); } -int icmp_read_reply(int fd, struct sockaddr *from, int fromlen, +int icmp_read_reply(int fd, struct sockaddr *from, socklen_t fromlen, __u8 *buf, int buflen) { - struct iovec iov; int len; len = recvfrom(fd, buf, buflen, 0, from, &fromlen); @@ -318,7 +318,7 @@ int icmp_read_reply(int fd, struct sockaddr *from, int fromlen, int icmp_open(float timeout) { - const int pmtudisc = IP_PMTUDISC_DO, yes = 1; + const int pmtudisc = IP_PMTUDISC_DO; struct timeval tv; int fd; |