aboutsummaryrefslogtreecommitdiff
path: root/networking/traceroute.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-22 14:04:27 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-22 14:04:27 +0000
commit35d4da0fb5884236fa7a131a13416268239c9e69 (patch)
tree1598327194a13be915980de0cb8be6a84e5c362c /networking/traceroute.c
parent85629f08bcea5d4a44b6d511422fd608bbc3fc45 (diff)
downloadbusybox-w32-35d4da0fb5884236fa7a131a13416268239c9e69.tar.gz
busybox-w32-35d4da0fb5884236fa7a131a13416268239c9e69.tar.bz2
busybox-w32-35d4da0fb5884236fa7a131a13416268239c9e69.zip
exterminate u_intXXX.
fix ping6 buglet (memset is too short), minor sync between ping and ping6
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r--networking/traceroute.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 0f3da90d6..5eac6cd1e 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -268,7 +268,7 @@ struct udpiphdr {
268struct hostinfo { 268struct hostinfo {
269 char *name; 269 char *name;
270 int n; 270 int n;
271 u_int32_t *addrs; 271 uint32_t *addrs;
272}; 272};
273 273
274/* Data section of the probe packet */ 274/* Data section of the probe packet */
@@ -279,7 +279,7 @@ struct outdata {
279}; 279};
280 280
281struct IFADDRLIST { 281struct IFADDRLIST {
282 u_int32_t addr; 282 uint32_t addr;
283 char device[sizeof(struct ifreq)]; 283 char device[sizeof(struct ifreq)];
284}; 284};
285 285
@@ -299,9 +299,9 @@ static struct icmp *outicmp; /* last output (icmp) packet */
299 299
300#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE 300#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
301/* Maximum number of gateways (include room for one noop) */ 301/* Maximum number of gateways (include room for one noop) */
302#define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(u_int32_t))) 302#define NGATEWAYS ((int)((MAX_IPOPTLEN - IPOPT_MINOFF - 1) / sizeof(uint32_t)))
303/* loose source route gateway list (including room for final destination) */ 303/* loose source route gateway list (including room for final destination) */
304static u_int32_t gwlist[NGATEWAYS + 1]; 304static uint32_t gwlist[NGATEWAYS + 1];
305#endif 305#endif
306 306
307static int s; /* receive (icmp) socket file descriptor */ 307static int s; /* receive (icmp) socket file descriptor */
@@ -429,7 +429,7 @@ ifaddrlist(struct IFADDRLIST **ipaddrp)
429 429
430 430
431static void 431static void
432setsin(struct sockaddr_in *addr_sin, u_int32_t addr) 432setsin(struct sockaddr_in *addr_sin, uint32_t addr)
433{ 433{
434 memset(addr_sin, 0, sizeof(*addr_sin)); 434 memset(addr_sin, 0, sizeof(*addr_sin));
435#ifdef HAVE_SOCKADDR_SA_LEN 435#ifdef HAVE_SOCKADDR_SA_LEN
@@ -448,8 +448,8 @@ findsaddr(const struct sockaddr_in *to, struct sockaddr_in *from)
448{ 448{
449 int i, n; 449 int i, n;
450 FILE *f; 450 FILE *f;
451 u_int32_t mask; 451 uint32_t mask;
452 u_int32_t dest, tmask; 452 uint32_t dest, tmask;
453 struct IFADDRLIST *al; 453 struct IFADDRLIST *al;
454 char buf[256], tdevice[256], device[256]; 454 char buf[256], tdevice[256], device[256];
455 455
@@ -641,7 +641,7 @@ send_probe(int seq, int ttl, struct timeval *tp)
641 int nshorts, i; 641 int nshorts, i;
642 642
643 sp = (uint16_t *)outip; 643 sp = (uint16_t *)outip;
644 nshorts = (u_int)packlen / sizeof(uint16_t); 644 nshorts = (unsigned)packlen / sizeof(uint16_t);
645 i = 0; 645 i = 0;
646 printf("[ %d bytes", packlen); 646 printf("[ %d bytes", packlen);
647 while (--nshorts >= 0) { 647 while (--nshorts >= 0) {
@@ -776,7 +776,7 @@ packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq)
776#if ENABLE_FEATURE_TRACEROUTE_VERBOSE 776#if ENABLE_FEATURE_TRACEROUTE_VERBOSE
777 if (verbose) { 777 if (verbose) {
778 int i; 778 int i;
779 u_int32_t *lp = (u_int32_t *)&icp->icmp_ip; 779 uint32_t *lp = (uint32_t *)&icp->icmp_ip;
780 780
781 printf("\n%d bytes from %s to " 781 printf("\n%d bytes from %s to "
782 "%s: icmp type %d (%s) code %d\n", 782 "%s: icmp type %d (%s) code %d\n",
@@ -838,7 +838,7 @@ gethostinfo(const char *host)
838 struct hostent *hp; 838 struct hostent *hp;
839 struct hostinfo *hi; 839 struct hostinfo *hi;
840 char **p; 840 char **p;
841 u_int32_t addr, *ap; 841 uint32_t addr, *ap;
842 842
843 hi = xzalloc(sizeof(*hi)); 843 hi = xzalloc(sizeof(*hi));
844 addr = inet_addr(host); 844 addr = inet_addr(host);
@@ -874,7 +874,7 @@ freehostinfo(struct hostinfo *hi)
874 874
875#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE 875#if ENABLE_FEATURE_TRACEROUTE_SOURCE_ROUTE
876static void 876static void
877getaddr(u_int32_t *ap, const char *host) 877getaddr(uint32_t *ap, const char *host)
878{ 878{
879 struct hostinfo *hi; 879 struct hostinfo *hi;
880 880
@@ -892,7 +892,7 @@ traceroute_main(int argc, char *argv[])
892 892
893 int code, n; 893 int code, n;
894 unsigned char *outp; 894 unsigned char *outp;
895 u_int32_t *ap; 895 uint32_t *ap;
896 struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom; 896 struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom;
897 struct sockaddr_in *to = (struct sockaddr_in *)&whereto; 897 struct sockaddr_in *to = (struct sockaddr_in *)&whereto;
898 struct hostinfo *hi; 898 struct hostinfo *hi;
@@ -915,7 +915,7 @@ traceroute_main(int argc, char *argv[])
915 int nprobes = 3; 915 int nprobes = 3;
916 char *nprobes_str = NULL; 916 char *nprobes_str = NULL;
917 char *waittime_str = NULL; 917 char *waittime_str = NULL;
918 u_int pausemsecs = 0; 918 unsigned pausemsecs = 0;
919 char *pausemsecs_str = NULL; 919 char *pausemsecs_str = NULL;
920 int first_ttl = 1; 920 int first_ttl = 1;
921 char *first_ttl_str = NULL; 921 char *first_ttl_str = NULL;
@@ -1211,7 +1211,7 @@ traceroute_main(int argc, char *argv[])
1211 (void)fflush(stderr); 1211 (void)fflush(stderr);
1212 1212
1213 for (ttl = first_ttl; ttl <= max_ttl; ++ttl) { 1213 for (ttl = first_ttl; ttl <= max_ttl; ++ttl) {
1214 u_int32_t lastaddr = 0; 1214 uint32_t lastaddr = 0;
1215 int gotlastaddr = 0; 1215 int gotlastaddr = 0;
1216 int got_there = 0; 1216 int got_there = 0;
1217 int unreachable = 0; 1217 int unreachable = 0;