exterminate u_intXXX.
fix ping6 buglet (memset is too short), minor sync between ping and ping6
This commit is contained in:
@@ -171,7 +171,7 @@ static void input_backward(unsigned num)
|
|||||||
if (cmdedit_x >= num) {
|
if (cmdedit_x >= num) {
|
||||||
cmdedit_x -= num;
|
cmdedit_x -= num;
|
||||||
if (num <= 4) {
|
if (num <= 4) {
|
||||||
do putchar('\b'); while (--num);
|
printf("\b\b\b\b" + (4-num));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("\033[%uD", num);
|
printf("\033[%uD", num);
|
||||||
@@ -183,7 +183,7 @@ static void input_backward(unsigned num)
|
|||||||
count_y = 1 + (num / cmdedit_termw);
|
count_y = 1 + (num / cmdedit_termw);
|
||||||
cmdedit_y -= count_y;
|
cmdedit_y -= count_y;
|
||||||
cmdedit_x = cmdedit_termw * count_y - num;
|
cmdedit_x = cmdedit_termw * count_y - num;
|
||||||
/* go to 1st col; go up; go to correct column */
|
/* go to 1st column; go up; go to correct column */
|
||||||
printf("\r" "\033[%dA" "\033[%dC", count_y, cmdedit_x);
|
printf("\r" "\033[%dA" "\033[%dC", count_y, cmdedit_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1707,7 +1707,7 @@ chargen_dg(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
|||||||
* some seventy years Bell Labs was asleep.
|
* some seventy years Bell Labs was asleep.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static u_int machtime(void)
|
static unsigned machtime(void)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
|
||||||
@@ -1715,14 +1715,14 @@ static u_int machtime(void)
|
|||||||
fprintf(stderr, "Unable to get time of day\n");
|
fprintf(stderr, "Unable to get time of day\n");
|
||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
return htonl((u_int) tv.tv_sec + 2208988800UL);
|
return htonl((unsigned) tv.tv_sec + 2208988800UL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
static void
|
static void
|
||||||
machtime_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
machtime_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
u_int result;
|
unsigned result;
|
||||||
|
|
||||||
result = machtime();
|
result = machtime();
|
||||||
(void) write(s, (char *) &result, sizeof(result));
|
(void) write(s, (char *) &result, sizeof(result));
|
||||||
@@ -1732,7 +1732,7 @@ machtime_stream(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
|||||||
static void
|
static void
|
||||||
machtime_dg(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
machtime_dg(int s, servtab_t *sep ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
u_int result;
|
unsigned result;
|
||||||
/* struct sockaddr_storage ss; */
|
/* struct sockaddr_storage ss; */
|
||||||
struct sockaddr sa;
|
struct sockaddr sa;
|
||||||
struct sockaddr_in *dg_sin;
|
struct sockaddr_in *dg_sin;
|
||||||
|
@@ -1,13 +1,15 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* vi: set sw=4 ts=4: */
|
||||||
/*
|
/*
|
||||||
* $Id: ping.c,v 1.56 2004/03/15 08:28:48 andersen Exp $
|
|
||||||
* Mini ping implementation for busybox
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
*
|
*
|
||||||
* Adapted from the ping in netkit-base 0.10:
|
* Adapted from the ping in netkit-base 0.10:
|
||||||
* Copyright (c) 1989 The Regents of the University of California.
|
* Copyright (c) 1989 The Regents of the University of California.
|
||||||
* Derived from software contributed to Berkeley by Mike Muuss.
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This code is derived from software contributed to Berkeley by
|
||||||
|
* Mike Muuss.
|
||||||
*
|
*
|
||||||
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
|
||||||
*/
|
*/
|
||||||
@@ -74,7 +76,7 @@ static void ping(const char *host)
|
|||||||
|
|
||||||
pingsock = create_icmp_socket();
|
pingsock = create_icmp_socket();
|
||||||
|
|
||||||
memset(&pingaddr, 0, sizeof(struct sockaddr_in));
|
memset(&pingaddr, 0, sizeof(pingaddr));
|
||||||
|
|
||||||
pingaddr.sin_family = AF_INET;
|
pingaddr.sin_family = AF_INET;
|
||||||
h = xgethostbyname(host);
|
h = xgethostbyname(host);
|
||||||
@@ -202,7 +204,7 @@ static void sendping(int junk)
|
|||||||
pkt->icmp_cksum = 0;
|
pkt->icmp_cksum = 0;
|
||||||
pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
|
pkt->icmp_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
|
||||||
pkt->icmp_id = myid;
|
pkt->icmp_id = myid;
|
||||||
CLR(ntohs(pkt->icmp_seq) % MAX_DUP_CHK);
|
CLR((uint16_t)ntransmitted % MAX_DUP_CHK);
|
||||||
ntransmitted++;
|
ntransmitted++;
|
||||||
|
|
||||||
gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
|
gettimeofday((struct timeval *) &pkt->icmp_dun, NULL);
|
||||||
@@ -270,7 +272,7 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
|
|||||||
return; /* not our ping */
|
return; /* not our ping */
|
||||||
|
|
||||||
if (icmppkt->icmp_type == ICMP_ECHOREPLY) {
|
if (icmppkt->icmp_type == ICMP_ECHOREPLY) {
|
||||||
u_int16_t recv_seq = ntohs(icmppkt->icmp_seq);
|
uint16_t recv_seq = ntohs(icmppkt->icmp_seq);
|
||||||
++nreceived;
|
++nreceived;
|
||||||
tp = (struct timeval *) icmppkt->icmp_data;
|
tp = (struct timeval *) icmppkt->icmp_data;
|
||||||
|
|
||||||
@@ -307,11 +309,12 @@ static void unpack(char *buf, int sz, struct sockaddr_in *from)
|
|||||||
if (dupflag)
|
if (dupflag)
|
||||||
printf(" (DUP!)");
|
printf(" (DUP!)");
|
||||||
puts("");
|
puts("");
|
||||||
} else
|
} else {
|
||||||
if (icmppkt->icmp_type != ICMP_ECHO)
|
if (icmppkt->icmp_type != ICMP_ECHO)
|
||||||
bb_error_msg("warning: got ICMP %d (%s)",
|
bb_error_msg("warning: got ICMP %d (%s)",
|
||||||
icmppkt->icmp_type,
|
icmppkt->icmp_type,
|
||||||
icmp_type_name(icmppkt->icmp_type));
|
icmp_type_name(icmppkt->icmp_type));
|
||||||
|
}
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -326,7 +329,7 @@ static void ping(const char *host)
|
|||||||
xbind(pingsock, (struct sockaddr*)&sourceaddr, sizeof(sourceaddr));
|
xbind(pingsock, (struct sockaddr*)&sourceaddr, sizeof(sourceaddr));
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&pingaddr, 0, sizeof(struct sockaddr_in));
|
memset(&pingaddr, 0, sizeof(pingaddr));
|
||||||
|
|
||||||
pingaddr.sin_family = AF_INET;
|
pingaddr.sin_family = AF_INET;
|
||||||
hostent = xgethostbyname(host);
|
hostent = xgethostbyname(host);
|
||||||
@@ -339,7 +342,7 @@ static void ping(const char *host)
|
|||||||
setsockopt_broadcast(pingsock);
|
setsockopt_broadcast(pingsock);
|
||||||
|
|
||||||
/* set recv buf for broadcast pings */
|
/* set recv buf for broadcast pings */
|
||||||
sockopt = 48 * 1024;
|
sockopt = 48 * 1024; /* explain why 48k? */
|
||||||
setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, (char *) &sockopt,
|
setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, (char *) &sockopt,
|
||||||
sizeof(sockopt));
|
sizeof(sockopt));
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
/* vi: set sw=4 ts=4: */
|
/* vi: set sw=4 ts=4: */
|
||||||
/*
|
/*
|
||||||
* $Id: ping6.c,v 1.6 2004/03/15 08:28:48 andersen Exp $
|
|
||||||
* Mini ping implementation for busybox
|
* Mini ping implementation for busybox
|
||||||
*
|
*
|
||||||
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
|
||||||
@@ -67,7 +66,7 @@ static void ping(const char *host)
|
|||||||
|
|
||||||
pingsock = create_icmp6_socket();
|
pingsock = create_icmp6_socket();
|
||||||
|
|
||||||
memset(&pingaddr, 0, sizeof(struct sockaddr_in));
|
memset(&pingaddr, 0, sizeof(pingaddr));
|
||||||
|
|
||||||
pingaddr.sin6_family = AF_INET6;
|
pingaddr.sin6_family = AF_INET6;
|
||||||
h = xgethostbyname2(host, AF_INET6);
|
h = xgethostbyname2(host, AF_INET6);
|
||||||
@@ -196,7 +195,7 @@ static void sendping(int junk)
|
|||||||
pkt->icmp6_cksum = 0;
|
pkt->icmp6_cksum = 0;
|
||||||
pkt->icmp6_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
|
pkt->icmp6_seq = htons(ntransmitted); /* don't ++ here, it can be a macro */
|
||||||
pkt->icmp6_id = myid;
|
pkt->icmp6_id = myid;
|
||||||
CLR(pkt->icmp6_seq % MAX_DUP_CHK);
|
CLR((uint16_t)ntransmitted % MAX_DUP_CHK);
|
||||||
ntransmitted++;
|
ntransmitted++;
|
||||||
|
|
||||||
gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);
|
gettimeofday((struct timeval *) &pkt->icmp6_data8[4], NULL);
|
||||||
@@ -220,7 +219,7 @@ static void sendping(int junk)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* RFC3542 changed some definitions from RFC2292 for no good reason, whee !
|
/* RFC3542 changed some definitions from RFC2292 for no good reason, whee!
|
||||||
* the newer 3542 uses a MLD_ prefix where as 2292 uses ICMP6_ prefix */
|
* the newer 3542 uses a MLD_ prefix where as 2292 uses ICMP6_ prefix */
|
||||||
#ifndef MLD_LISTENER_QUERY
|
#ifndef MLD_LISTENER_QUERY
|
||||||
# define MLD_LISTENER_QUERY ICMP6_MEMBERSHIP_QUERY
|
# define MLD_LISTENER_QUERY ICMP6_MEMBERSHIP_QUERY
|
||||||
@@ -266,6 +265,7 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
|
|||||||
return; /* not our ping */
|
return; /* not our ping */
|
||||||
|
|
||||||
if (icmppkt->icmp6_type == ICMP6_ECHO_REPLY) {
|
if (icmppkt->icmp6_type == ICMP6_ECHO_REPLY) {
|
||||||
|
uint16_t recv_seq = ntohs(icmppkt->icmp6_seq);
|
||||||
++nreceived;
|
++nreceived;
|
||||||
tp = (struct timeval *) &icmppkt->icmp6_data8[4];
|
tp = (struct timeval *) &icmppkt->icmp6_data8[4];
|
||||||
|
|
||||||
@@ -282,12 +282,12 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
|
|||||||
if (triptime > tmax)
|
if (triptime > tmax)
|
||||||
tmax = triptime;
|
tmax = triptime;
|
||||||
|
|
||||||
if (TST(icmppkt->icmp6_seq % MAX_DUP_CHK)) {
|
if (TST(recv_seq % MAX_DUP_CHK)) {
|
||||||
++nrepeats;
|
++nrepeats;
|
||||||
--nreceived;
|
--nreceived;
|
||||||
dupflag = 1;
|
dupflag = 1;
|
||||||
} else {
|
} else {
|
||||||
SET(icmppkt->icmp6_seq % MAX_DUP_CHK);
|
SET(recv_seq % MAX_DUP_CHK);
|
||||||
dupflag = 0;
|
dupflag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,16 +297,19 @@ static void unpack(char *packet, int sz, struct sockaddr_in6 *from, int hoplimit
|
|||||||
printf("%d bytes from %s: icmp6_seq=%u", sz,
|
printf("%d bytes from %s: icmp6_seq=%u", sz,
|
||||||
inet_ntop(AF_INET6, &pingaddr.sin6_addr,
|
inet_ntop(AF_INET6, &pingaddr.sin6_addr,
|
||||||
buf, sizeof(buf)),
|
buf, sizeof(buf)),
|
||||||
ntohs(icmppkt->icmp6_seq));
|
recv_seq);
|
||||||
printf(" ttl=%d time=%lu.%lu ms", hoplimit,
|
printf(" ttl=%d time=%lu.%lu ms", hoplimit,
|
||||||
triptime / 10, triptime % 10);
|
triptime / 10, triptime % 10);
|
||||||
if (dupflag)
|
if (dupflag)
|
||||||
printf(" (DUP!)");
|
printf(" (DUP!)");
|
||||||
puts("");
|
puts("");
|
||||||
} else
|
} else {
|
||||||
if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST)
|
if (icmppkt->icmp6_type != ICMP6_ECHO_REQUEST)
|
||||||
bb_error_msg("warning: got ICMP %d (%s)",
|
bb_error_msg("warning: got ICMP %d (%s)",
|
||||||
icmppkt->icmp6_type, icmp6_type_name(icmppkt->icmp6_type));
|
icmppkt->icmp6_type,
|
||||||
|
icmp6_type_name(icmppkt->icmp6_type));
|
||||||
|
}
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ping(const char *host)
|
static void ping(const char *host)
|
||||||
@@ -321,7 +324,7 @@ static void ping(const char *host)
|
|||||||
|
|
||||||
pingsock = create_icmp6_socket();
|
pingsock = create_icmp6_socket();
|
||||||
|
|
||||||
memset(&pingaddr, 0, sizeof(struct sockaddr_in));
|
memset(&pingaddr, 0, sizeof(pingaddr));
|
||||||
|
|
||||||
pingaddr.sin6_family = AF_INET6;
|
pingaddr.sin6_family = AF_INET6;
|
||||||
hostent = xgethostbyname2(host, AF_INET6);
|
hostent = xgethostbyname2(host, AF_INET6);
|
||||||
@@ -431,7 +434,7 @@ int ping6_main(int argc, char **argv)
|
|||||||
"%s: invalid interface name", opt_I);
|
"%s: invalid interface name", opt_I);
|
||||||
}
|
}
|
||||||
|
|
||||||
myid = (int16_t)getpid();
|
myid = (int16_t) getpid();
|
||||||
ping(argv[optind]);
|
ping(argv[optind]);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -268,7 +268,7 @@ struct udpiphdr {
|
|||||||
struct hostinfo {
|
struct hostinfo {
|
||||||
char *name;
|
char *name;
|
||||||
int n;
|
int n;
|
||||||
u_int32_t *addrs;
|
uint32_t *addrs;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Data section of the probe packet */
|
/* Data section of the probe packet */
|
||||||
@@ -279,7 +279,7 @@ struct outdata {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct IFADDRLIST {
|
struct IFADDRLIST {
|
||||||
u_int32_t addr;
|
uint32_t addr;
|
||||||
char device[sizeof(struct ifreq)];
|
char device[sizeof(struct ifreq)];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -299,9 +299,9 @@ static struct icmp *outicmp; /* last output (icmp) packet */
|
|||||||
|
|
||||||
#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
|
#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
|
||||||
/* Maximum number of gateways (include room for one noop) */
|
/* Maximum number of gateways (include room for one noop) */
|
||||||
#define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(u_int32_t)))
|
#define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(uint32_t)))
|
||||||
/* loose source route gateway list (including room for final destination) */
|
/* loose source route gateway list (including room for final destination) */
|
||||||
static u_int32_t gwlist[NGATEWAYS + 1];
|
static uint32_t gwlist[NGATEWAYS + 1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int s; /* receive (icmp) socket file descriptor */
|
static int s; /* receive (icmp) socket file descriptor */
|
||||||
@@ -429,7 +429,7 @@ ifaddrlist(struct IFADDRLIST **ipaddrp)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setsin(struct sockaddr_in *addr_sin, u_int32_t addr)
|
setsin(struct sockaddr_in *addr_sin, uint32_t addr)
|
||||||
{
|
{
|
||||||
memset(addr_sin, 0, sizeof(*addr_sin));
|
memset(addr_sin, 0, sizeof(*addr_sin));
|
||||||
#ifdef HAVE_SOCKADDR_SA_LEN
|
#ifdef HAVE_SOCKADDR_SA_LEN
|
||||||
@@ -448,8 +448,8 @@ findsaddr(const struct sockaddr_in *to, struct sockaddr_in *from)
|
|||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
u_int32_t mask;
|
uint32_t mask;
|
||||||
u_int32_t dest, tmask;
|
uint32_t dest, tmask;
|
||||||
struct IFADDRLIST *al;
|
struct IFADDRLIST *al;
|
||||||
char buf[256], tdevice[256], device[256];
|
char buf[256], tdevice[256], device[256];
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@ send_probe(int seq, int ttl, struct timeval *tp)
|
|||||||
int nshorts, i;
|
int nshorts, i;
|
||||||
|
|
||||||
sp = (uint16_t *)outip;
|
sp = (uint16_t *)outip;
|
||||||
nshorts = (u_int)packlen / sizeof(uint16_t);
|
nshorts = (unsigned)packlen / sizeof(uint16_t);
|
||||||
i = 0;
|
i = 0;
|
||||||
printf("[ %d bytes", packlen);
|
printf("[ %d bytes", packlen);
|
||||||
while (--nshorts >= 0) {
|
while (--nshorts >= 0) {
|
||||||
@@ -776,7 +776,7 @@ packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq)
|
|||||||
#if ENABLE_FEATURE_TRACEROUTE_VERBOSE
|
#if ENABLE_FEATURE_TRACEROUTE_VERBOSE
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
int i;
|
int i;
|
||||||
u_int32_t *lp = (u_int32_t *)&icp->icmp_ip;
|
uint32_t *lp = (uint32_t *)&icp->icmp_ip;
|
||||||
|
|
||||||
printf("\n%d bytes from %s to "
|
printf("\n%d bytes from %s to "
|
||||||
"%s: icmp type %d (%s) code %d\n",
|
"%s: icmp type %d (%s) code %d\n",
|
||||||
@@ -838,7 +838,7 @@ gethostinfo(const char *host)
|
|||||||
struct hostent *hp;
|
struct hostent *hp;
|
||||||
struct hostinfo *hi;
|
struct hostinfo *hi;
|
||||||
char **p;
|
char **p;
|
||||||
u_int32_t addr, *ap;
|
uint32_t addr, *ap;
|
||||||
|
|
||||||
hi = xzalloc(sizeof(*hi));
|
hi = xzalloc(sizeof(*hi));
|
||||||
addr = inet_addr(host);
|
addr = inet_addr(host);
|
||||||
@@ -874,7 +874,7 @@ freehostinfo(struct hostinfo *hi)
|
|||||||
|
|
||||||
#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
|
#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
|
||||||
static void
|
static void
|
||||||
getaddr(u_int32_t *ap, const char *host)
|
getaddr(uint32_t *ap, const char *host)
|
||||||
{
|
{
|
||||||
struct hostinfo *hi;
|
struct hostinfo *hi;
|
||||||
|
|
||||||
@@ -892,7 +892,7 @@ traceroute_main(int argc, char *argv[])
|
|||||||
|
|
||||||
int code, n;
|
int code, n;
|
||||||
unsigned char *outp;
|
unsigned char *outp;
|
||||||
u_int32_t *ap;
|
uint32_t *ap;
|
||||||
struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom;
|
struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom;
|
||||||
struct sockaddr_in *to = (struct sockaddr_in *)&whereto;
|
struct sockaddr_in *to = (struct sockaddr_in *)&whereto;
|
||||||
struct hostinfo *hi;
|
struct hostinfo *hi;
|
||||||
@@ -915,7 +915,7 @@ traceroute_main(int argc, char *argv[])
|
|||||||
int nprobes = 3;
|
int nprobes = 3;
|
||||||
char *nprobes_str = NULL;
|
char *nprobes_str = NULL;
|
||||||
char *waittime_str = NULL;
|
char *waittime_str = NULL;
|
||||||
u_int pausemsecs = 0;
|
unsigned pausemsecs = 0;
|
||||||
char *pausemsecs_str = NULL;
|
char *pausemsecs_str = NULL;
|
||||||
int first_ttl = 1;
|
int first_ttl = 1;
|
||||||
char *first_ttl_str = NULL;
|
char *first_ttl_str = NULL;
|
||||||
@@ -1211,7 +1211,7 @@ traceroute_main(int argc, char *argv[])
|
|||||||
(void)fflush(stderr);
|
(void)fflush(stderr);
|
||||||
|
|
||||||
for (ttl = first_ttl; ttl <= max_ttl; ++ttl) {
|
for (ttl = first_ttl; ttl <= max_ttl; ++ttl) {
|
||||||
u_int32_t lastaddr = 0;
|
uint32_t lastaddr = 0;
|
||||||
int gotlastaddr = 0;
|
int gotlastaddr = 0;
|
||||||
int got_there = 0;
|
int got_there = 0;
|
||||||
int unreachable = 0;
|
int unreachable = 0;
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
/* This list holds information about clients. The xid_* functions manipulate this list. */
|
/* This list holds information about clients. The xid_* functions manipulate this list. */
|
||||||
static struct xid_item {
|
static struct xid_item {
|
||||||
u_int32_t xid;
|
uint32_t xid;
|
||||||
struct sockaddr_in ip;
|
struct sockaddr_in ip;
|
||||||
int client;
|
int client;
|
||||||
time_t timestamp;
|
time_t timestamp;
|
||||||
@@ -30,7 +30,7 @@ static struct xid_item {
|
|||||||
} dhcprelay_xid_list = {0, {0}, 0, 0, NULL};
|
} dhcprelay_xid_list = {0, {0}, 0, 0, NULL};
|
||||||
|
|
||||||
|
|
||||||
static struct xid_item * xid_add(u_int32_t xid, struct sockaddr_in *ip, int client)
|
static struct xid_item * xid_add(uint32_t xid, struct sockaddr_in *ip, int client)
|
||||||
{
|
{
|
||||||
struct xid_item *item;
|
struct xid_item *item;
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ static void xid_expire(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct xid_item * xid_find(u_int32_t xid)
|
static struct xid_item * xid_find(uint32_t xid)
|
||||||
{
|
{
|
||||||
struct xid_item *item = dhcprelay_xid_list.next;
|
struct xid_item *item = dhcprelay_xid_list.next;
|
||||||
while (item != NULL) {
|
while (item != NULL) {
|
||||||
@@ -79,7 +79,7 @@ static struct xid_item * xid_find(u_int32_t xid)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xid_del(u_int32_t xid)
|
static void xid_del(uint32_t xid)
|
||||||
{
|
{
|
||||||
struct xid_item *item = dhcprelay_xid_list.next;
|
struct xid_item *item = dhcprelay_xid_list.next;
|
||||||
struct xid_item *last = &dhcprelay_xid_list;
|
struct xid_item *last = &dhcprelay_xid_list;
|
||||||
|
Reference in New Issue
Block a user