]>
Commit | Line | Data |
---|---|---|
724451c6 MK |
1 | diff -uNr dip-3.3.7o/command.c dip-3.3.7o-64/command.c |
2 | --- dip-3.3.7o/command.c Tue May 30 15:42:24 2000 | |
3 | +++ dip-3.3.7o-64/command.c Tue May 30 15:44:06 2000 | |
4 | @@ -84,6 +84,10 @@ | |
5 | static char var_securidfixed[9] = ""; /* fixed part of secureID */ | |
6 | #endif /* SECUREID */ | |
7 | ||
8 | +#ifndef HAS_STPCPY | |
9 | +char *stpcpy(char *dest, const char *src); | |
10 | +#endif | |
11 | + | |
12 | static void | |
13 | sig_exit(void) | |
14 | { | |
15 | @@ -682,7 +686,7 @@ | |
16 | nargv = malloc (argc*sizeof(char*)); /* allocate the array of pointers */ | |
17 | if (nargv == NULL) /* Ooops? */ | |
18 | { | |
19 | - fprintf (stderr, "error: Couldn't allocate %ld bytes for" /* Ooops! */ | |
20 | + fprintf (stderr, "error: Couldn't allocate %d bytes for" /* Ooops! */ | |
21 | " onexit commands array: `%s'\n", | |
22 | argc*sizeof(char*), strerror (errno) ); | |
23 | return -1; | |
24 | @@ -696,7 +700,7 @@ | |
25 | nargv[cnt] = malloc (strlen(argv[cnt]) + 1); /* allocate */ | |
26 | if (nargv[cnt] == NULL) /* Oops? */ | |
27 | { | |
28 | - fprintf (stderr, "error: Couldn't allocate %ld bytes for argument %d" | |
29 | + fprintf (stderr, "error: Couldn't allocate %d bytes for argument %d" | |
30 | " of the onexit command: `%s'\n", | |
31 | strlen (argv[cnt]), cnt, strerror (errno) ); | |
32 | arg_clean (argc, nargv); /* clean */ | |
33 | @@ -2227,7 +2231,10 @@ | |
34 | } | |
35 | } | |
36 | ||
37 | -#ifdef __alpha__ | |
38 | +/* This used to be Alpha-specific code, but the assembler code is not very | |
39 | + * portable to new binutils versions. */ | |
40 | + | |
41 | +#ifdef unix | |
42 | ||
43 | /* | |
44 | * The following routines come from linux/arch/alpha/lib/checksum.c and | |
45 | @@ -2235,7 +2242,7 @@ | |
46 | */ | |
47 | ||
48 | static inline unsigned short | |
49 | -from64to16(unsigned long x) | |
50 | +from64to16(u_int64_t x) | |
51 | { | |
52 | /* add up 32-bit words for 33 bits */ | |
53 | x = (x & 0xffffffff) + (x >> 32); | |
54 | @@ -2255,15 +2262,15 @@ | |
55 | * inner loop could be unrolled a bit further, and there are better | |
56 | * ways to do the carry, but this is reasonable. | |
57 | */ | |
58 | -static inline unsigned long | |
59 | +static inline u_int64_t | |
60 | do_csum(unsigned char * buff, int len) | |
61 | { | |
62 | int odd, count; | |
63 | - unsigned long result = 0; | |
64 | + u_int64_t result = 0; | |
65 | ||
66 | if (len <= 0) | |
67 | goto out; | |
68 | - odd = 1 & (unsigned long) buff; | |
69 | + odd = 1 & (int) buff; | |
70 | if (odd) { | |
71 | result = *buff << 8; | |
72 | len--; | |
73 | @@ -2271,7 +2278,7 @@ | |
74 | } | |
75 | count = len >> 1; /* nr of 16-bit words.. */ | |
76 | if (count) { | |
77 | - if (2 & (unsigned long) buff) { | |
78 | + if (2 & (int) buff) { | |
79 | result += *(unsigned short *) buff; | |
80 | count--; | |
81 | len -= 2; | |
82 | @@ -2279,7 +2286,7 @@ | |
83 | } | |
84 | count >>= 1; /* nr of 32-bit words.. */ | |
85 | if (count) { | |
86 | - if (4 & (unsigned long) buff) { | |
87 | + if (4 & (int) buff) { | |
88 | result += *(unsigned int *) buff; | |
89 | count--; | |
90 | len -= 4; | |
91 | @@ -2287,9 +2294,9 @@ | |
92 | } | |
93 | count >>= 1; /* nr of 64-bit words.. */ | |
94 | if (count) { | |
95 | - unsigned long carry = 0; | |
96 | + u_int64_t carry = 0; | |
97 | do { | |
98 | - unsigned long w = *(unsigned long *) buff; | |
99 | + u_int64_t w = *(u_int64_t*) buff; | |
100 | count--; | |
101 | buff += 8; | |
102 | result += carry; | |
103 | @@ -2332,21 +2339,21 @@ | |
104 | * computes the checksum of the TCP/UDP pseudo-header | |
105 | * returns a 16-bit checksum, already complemented. | |
106 | */ | |
107 | -unsigned short int csum_tcpudp_magic(unsigned long saddr, | |
108 | - unsigned long daddr, | |
109 | +unsigned short int csum_tcpudp_magic(u_int64_t saddr, | |
110 | + u_int64_t daddr, | |
111 | unsigned short len, | |
112 | unsigned short proto, | |
113 | unsigned int sum) | |
114 | { | |
115 | return ~from64to16(saddr + daddr + sum + | |
116 | - ((unsigned long) ntohs(len) << 16) + | |
117 | - ((unsigned long) proto << 8)); | |
118 | + ((u_int64_t) ntohs(len) << 16) + | |
119 | + ((u_int64_t) proto << 8)); | |
120 | } | |
121 | ||
122 | ||
123 | static unsigned short | |
124 | udp_check(struct udphdr *uh, int len, | |
125 | - unsigned long saddr, unsigned long daddr) | |
126 | + u_int64_t saddr, u_int64_t daddr) | |
127 | { | |
128 | return(csum_tcpudp_magic(saddr, daddr, len, IPPROTO_UDP, 0)); | |
129 | } | |
130 | diff -uNr dip-3.3.7o/login.c dip-3.3.7o-64/login.c | |
131 | --- dip-3.3.7o/login.c Tue Jun 13 14:46:31 1995 | |
132 | +++ dip-3.3.7o-64/login.c Tue May 30 15:34:14 2000 | |
133 | @@ -18,6 +18,10 @@ | |
134 | */ | |
135 | #include "dip.h" | |
136 | ||
137 | +#ifdef MIN | |
138 | +#undef MIN | |
139 | +#endif | |
140 | + | |
141 | #define MIN(a, b) ((a < b)? a : b) | |
142 | ||
143 | static int verify_inet_addr(char *p); |