version 1.72, 2008/06/25 21:15:19 |
version 1.73, 2008/07/08 21:07:57 |
|
|
} |
} |
#ifdef SO_OOBINLINE |
#ifdef SO_OOBINLINE |
{ |
{ |
int on = 1; |
int ret, on = 1; |
|
|
if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on)) |
ret = setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (char *)&on, sizeof(on)); |
< 0 && debug) { |
#ifndef SMALL |
warn("setsockopt"); |
if (ret < 0 && debug) |
} |
warn("setsockopt"); |
|
#endif /* !SMALL */ |
} |
} |
#endif /* SO_OOBINLINE */ |
#endif /* SO_OOBINLINE */ |
|
|
|
|
sig_t oldintr; |
sig_t oldintr; |
|
|
abrtflag = 0; |
abrtflag = 0; |
|
#ifndef SMALL |
if (debug) { |
if (debug) { |
fputs("---> ", ttyout); |
fputs("---> ", ttyout); |
va_start(ap, fmt); |
va_start(ap, fmt); |
|
|
putc('\n', ttyout); |
putc('\n', ttyout); |
(void)fflush(ttyout); |
(void)fflush(ttyout); |
} |
} |
|
#endif /* !SMALL */ |
if (cout == NULL) { |
if (cout == NULL) { |
warnx("No control connection for command."); |
warnx("No control connection for command."); |
code = -1; |
code = -1; |
|
|
void |
void |
send_noop_char() |
send_noop_char() |
{ |
{ |
|
#ifndef SMALL |
if (debug) |
if (debug) |
fprintf(ttyout, "---> %c\n", noop[current_nop_pos]); |
fprintf(ttyout, "---> %c\n", noop[current_nop_pos]); |
|
#endif /* !SMALL */ |
fputc(noop[current_nop_pos++], cout); |
fputc(noop[current_nop_pos++], cout); |
(void)fflush(cout); |
(void)fflush(cout); |
if (current_nop_pos >= NOOP_LENGTH) { |
if (current_nop_pos >= NOOP_LENGTH) { |
|
|
/* finish sending last incomplete noop */ |
/* finish sending last incomplete noop */ |
if (current_nop_pos != 0) { |
if (current_nop_pos != 0) { |
fputs(&(noop[current_nop_pos]), cout); |
fputs(&(noop[current_nop_pos]), cout); |
|
#ifndef SMALL |
if (debug) |
if (debug) |
fprintf(ttyout, "---> %s\n", &(noop[current_nop_pos])); |
fprintf(ttyout, "---> %s\n", &(noop[current_nop_pos])); |
|
#endif /* !SMALL */ |
(void)fflush(cout); |
(void)fflush(cout); |
current_nop_pos = 0; |
current_nop_pos = 0; |
full_noops_sent++; |
full_noops_sent++; |
|
|
warn("socket"); |
warn("socket"); |
return (1); |
return (1); |
} |
} |
|
#ifndef SMALL |
if ((options & SO_DEBUG) && |
if ((options & SO_DEBUG) && |
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, |
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, |
sizeof(on)) < 0) |
sizeof(on)) < 0) |
warn("setsockopt (ignored)"); |
warn("setsockopt (ignored)"); |
|
#endif /* !SMALL */ |
switch (data_addr.su_family) { |
switch (data_addr.su_family) { |
case AF_INET: |
case AF_INET: |
if (epsv4 && !epsv4bad) { |
if (epsv4 && !epsv4bad) { |
|
|
} |
} |
if (result != COMPLETE) { |
if (result != COMPLETE) { |
epsv4bad = 1; |
epsv4bad = 1; |
|
#ifndef SMALL |
if (debug) { |
if (debug) { |
fputs( |
fputs( |
"disabling epsv4 for this connection\n", |
"disabling epsv4 for this connection\n", |
ttyout); |
ttyout); |
} |
} |
|
#endif /* !SMALL */ |
} |
} |
} |
} |
if (result != COMPLETE) |
if (result != COMPLETE) |
|
|
warn("bind"); |
warn("bind"); |
goto bad; |
goto bad; |
} |
} |
|
#ifndef SMALL |
if (options & SO_DEBUG && |
if (options & SO_DEBUG && |
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, |
setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, |
sizeof(on)) < 0) |
sizeof(on)) < 0) |
warn("setsockopt (ignored)"); |
warn("setsockopt (ignored)"); |
|
#endif /* !SMALL */ |
namelen = sizeof(data_addr); |
namelen = sizeof(data_addr); |
if (getsockname(data, (struct sockaddr *)&data_addr, &namelen) < 0) { |
if (getsockname(data, (struct sockaddr *)&data_addr, &namelen) < 0) { |
warn("getsockname"); |
warn("getsockname"); |
|
|
af_tmp, hname, pbuf); |
af_tmp, hname, pbuf); |
if (result != COMPLETE) { |
if (result != COMPLETE) { |
epsv4bad = 1; |
epsv4bad = 1; |
|
#ifndef SMALL |
if (debug) { |
if (debug) { |
fputs( |
fputs( |
"disabling epsv4 for this connection\n", |
"disabling epsv4 for this connection\n", |
ttyout); |
ttyout); |
} |
} |
|
#endif /* !SMALL */ |
} |
} |
} |
} |
break; |
break; |