conditional getsockopt
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1189 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -183,7 +183,7 @@ get_xsockets (int *unix_socket, int *tcp_socket)
|
||||
close (unixfd);
|
||||
return -1;
|
||||
}
|
||||
#ifdef TCP_NODELAY
|
||||
#if defined(TCP_NODELAY) && defined(HAVE_SETSOCKOPT)
|
||||
setsockopt (tcpfd, IPPROTO_TCP, TCP_NODELAY, (void *)&one,
|
||||
sizeof(one));
|
||||
#endif
|
||||
@@ -326,6 +326,9 @@ suspicious_address (int sock, struct sockaddr_in addr)
|
||||
int len = sizeof(data);
|
||||
|
||||
return addr.sin_addr.s_addr != htonl(INADDR_LOOPBACK)
|
||||
#if defined(IP_OPTIONS) && defined(HAVE_GETSOCKOPT)
|
||||
|| getsockopt (sock, IPPROTO_IP, IP_OPTIONS, data, &len) < 0
|
||||
|| len != 0;
|
||||
|| len != 0
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
@@ -138,7 +138,7 @@ connect_host (char *host, char *user, des_cblock *key,
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef TCP_NODELAY
|
||||
#if defined(TCP_NODELAY) && defined(HAVE_SETSOCKOPT)
|
||||
setsockopt (s, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one));
|
||||
#endif
|
||||
|
||||
@@ -164,7 +164,7 @@ connect_host (char *host, char *user, des_cblock *key,
|
||||
status = krb_sendauth (KOPT_DO_MUTUAL, s, &text, "rcmd",
|
||||
host, krb_realmofhost (host),
|
||||
getpid(), &msg, &cred, schedule,
|
||||
&thisaddr, &thataddr, KXVERSION);
|
||||
&thisaddr, &thataddr, KX_VERSION);
|
||||
if (status != KSUCCESS) {
|
||||
fprintf (stderr, "%s: %s: %s\n", prog, host,
|
||||
krb_get_err_text(status));
|
||||
@@ -435,7 +435,7 @@ doit (char *host, char *user, int passivep, int debugp, int tcpp)
|
||||
strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
#ifdef TCP_NODELAY
|
||||
#if defined(TCP_NODELAY) && defined(HAVE_SETSOCKOPT)
|
||||
setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one));
|
||||
#endif
|
||||
++nchild;
|
||||
|
@@ -110,7 +110,7 @@ recv_conn (int sock, des_cblock *key, des_key_schedule schedule,
|
||||
&thataddr, &thisaddr, &auth, "", schedule,
|
||||
version);
|
||||
if (status != KSUCCESS ||
|
||||
strncmp(version, KXVERSION, KRB_SENDAUTH_VLEN) != 0) {
|
||||
strncmp(version, KX_VERSION, KRB_SENDAUTH_VLEN) != 0) {
|
||||
return 1;
|
||||
}
|
||||
if (krb_net_read (sock, user, sizeof(user)) != sizeof(user))
|
||||
@@ -187,7 +187,7 @@ doit_conn (int fd, struct sockaddr_in *thataddr,
|
||||
sprintf (msg, "socket: %s", strerror(errno));
|
||||
return fatal (sock, msg);
|
||||
}
|
||||
#ifdef TCP_NODELAY
|
||||
#if defined(TCP_NODELAY) && defined(HAVE_SETSOCKOPT)
|
||||
setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one));
|
||||
#endif
|
||||
if (connect (sock, (struct sockaddr *)thataddr,
|
||||
@@ -291,7 +291,7 @@ doit(int sock, int tcpp)
|
||||
sprintf (msg, "accept: %s\n", strerror (errno));
|
||||
return fatal (sock, msg);
|
||||
}
|
||||
#ifdef TCP_NODELAY
|
||||
#if defined(TCP_NODELAY) && defined(HAVE_SETSOCKOPT)
|
||||
setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&one,
|
||||
sizeof(one));
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user