if (debug) {
int s, ns, foo;
struct servent *sp;
- static struct sockaddr_in sin = { AF_INET };
+ static struct sockaddr_in sin4 = { AF_INET };
if (argc > 1) {
usage();
/* NOT REACHED */
} else if (argc == 1) {
if ((sp = getservbyname(*argv, "tcp"))) {
- sin.sin_port = sp->s_port;
+ sin4.sin_port = sp->s_port;
} else {
- sin.sin_port = atoi(*argv);
- if ((int)sin.sin_port <= 0) {
+ sin4.sin_port = atoi(*argv);
+ if ((int)sin4.sin_port <= 0) {
fprintf(stderr, "telnetd: %s: bad port #\n", *argv);
usage();
/* NOT REACHED */
}
- sin.sin_port = htons((u_short)sin.sin_port);
+ sin4.sin_port = htons((u_short)sin4.sin_port);
}
} else {
sp = getservbyname("telnet", "tcp");
fprintf(stderr, "telnetd: tcp/telnet: unknown service\n");
exit(1);
}
- sin.sin_port = sp->s_port;
+ sin4.sin_port = sp->s_port;
}
s = socket(AF_INET, SOCK_STREAM, 0);
}
(void) setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
(char *)&on, sizeof(on));
- if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
+ if (bind(s, (struct sockaddr *)&sin4, sizeof(sin4)) < 0) {
perror("bind");
exit(1);
}
perror("listen");
exit(1);
}
- foo = sizeof(sin);
- ns = accept(s, (struct sockaddr *)&sin, &foo);
+ foo = sizeof(sin4);
+ ns = accept(s, (struct sockaddr *)&sin4, &foo);
if (ns < 0) {
perror("accept");
exit(1);
static void encrypt_failure()
{
- char *error_message =
+ char *lerror_message =
"Encryption was not successfully negotiated. Goodbye.\r\n\r\n";
- writenet(error_message, strlen(error_message));
+ writenet(lerror_message, strlen(lerror_message));
netflush();
exit(1);
}