Skip to content

Commit

Permalink
Merge branch 'master' into V8_7-gt6477-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd-L-Miller committed Jan 23, 2018
2 parents ab2aeba + d5738cc commit 643d3a8
Show file tree
Hide file tree
Showing 64 changed files with 392 additions and 1,665 deletions.
24 changes: 1 addition & 23 deletions doc/admin-man/configure.tex
Expand Up @@ -2384,11 +2384,7 @@ \subsection{\label{sec:Network-Related-Config-File-Entries}Network-Related Confi
If \MacroNI{BIND\_ALL\_INTERFACES} is \Expr{True} (the default),
\MacroNI{NETWORK\_INTERFACE} controls what IP address
will be advertised as the public address of the daemon.
If multiple network interfaces match the value and
\MacroNI{ENABLE\_ADDRESS\_REWRITING} is \Expr{True} (the default),
the IP address that is chosen to be advertised will be the one that
is used to communicate with the \Condor{collector}.
If \MacroNI{ENABLE\_ADDRESS\_REWRITING} is \Expr{False}, the IP address
If multiple network interfaces match the value, the IP address
that is chosen to be advertised will be the one associated with the
first device (in system-defined order) that is in a public address
space, or a private address space, or a loopback address, in that
Expand Down Expand Up @@ -2488,24 +2484,6 @@ \subsection{\label{sec:Network-Related-Config-File-Entries}Network-Related Confi
authorization settings that rely on host addresses should be
considered accordingly.

\label{param:EnableAddressRewriting}
\item[\Macro{ENABLE\_ADDRESS\_REWRITING}]
A boolean value that defaults to \Expr{True}. When
\MacroNI{NETWORK\_INTERFACE} matches only one IP address or
\MacroNI{TCP\_FORWARDING\_HOST} is defined or
\MacroNI{NET\_REMAP\_ENABLE} is \Expr{True}, this setting has no effect and
the behavior is as though it had been set to \Expr{False}. When \Expr{True},
IP addresses published by HTCondor daemons are automatically rewritten to
match the IP address of the network interface used to make the
publication. For example, if the \Condor{schedd} advertises itself to
two pools via flocking, and the \Condor{collector} for one pool is reached
by the \Condor{schedd} through a private network interface, while
the \Condor{collector} for the other pool is reached through a different
network interface, the IP address published by the \Condor{schedd}
daemon will match the address of the respective network interfaces
used in the two cases. The intention is to make it easier for
HTCondor daemons to operate in a multi-homed environment.

\label{param:HighPort}
\item[\Macro{HIGHPORT}]
Specifies an upper limit of given port numbers for HTCondor to use,
Expand Down
10 changes: 5 additions & 5 deletions doc/admin-man/install.tex
Expand Up @@ -511,10 +511,10 @@ \subsubsection{\label{sec:install-rpms}
development releases and by Red Hat version number.
The 4 repositories are:
\begin{itemize}
\item \File{condor-stable-rhel6.repo}
\item \File{condor-stable-rhel7.repo}
\item \File{condor-development-rhel6.repo}
\item \File{condor-development-rhel7.repo}
\item \File{htcondor-stable-rhel6.repo}
\item \File{htcondor-stable-rhel7.repo}
\item \File{htcondor-development-rhel6.repo}
\item \File{htcondor-development-rhel7.repo}
\end{itemize}

Here is an ordered set of steps that get HTCondor running using the RPM.
Expand All @@ -530,7 +530,7 @@ \subsubsection{\label{sec:install-rpms}
\footnotesize
\begin{verbatim}
cd /etc/yum.repos.d
wget http://htcondor.org/yum/repo.d/condor-stable-rhel7.repo
wget http://htcondor.org/yum/repo.d/htcondor-stable-rhel7.repo
\end{verbatim}
\normalsize
Note that this step need be done only once;
Expand Down
6 changes: 2 additions & 4 deletions doc/admin-man/multiple-interfaces.tex
Expand Up @@ -112,10 +112,8 @@ \subsubsection{\label{sec:Using-BindAllInterfaces}Using
each with a separate IP, the daemon must choose which two IP addresses to
advertise so that other daemons and tools can connect to it.

By default, HTCondor advertises the IP address of the network interface
used to contact the \Condor{collector} as its public address,
since this is the most likely to be
accessible to other processes that query the same \Condor{collector}.
By default, HTCondor advertises the most public IP address available
on the machine.
The \Macro{NETWORK\_INTERFACE} configuration variable can be used
to specify the public IP address HTCondor should advertise, and
\Macro{PRIVATE\_NETWORK\_INTERFACE}, along with
Expand Down
22 changes: 20 additions & 2 deletions doc/version-history/8-7.history.tex
Expand Up @@ -29,15 +29,33 @@ \subsection*{\label{sec:New-8-7-7}Version 8.7.7}

\begin{itemize}

\item None.
\item Removed configuration parameters \MacroNI{ENABLE\_ADDRESS\_REWRITING}
and \MacroNI{SHARED\_PORT\_ADDRESS\_REWRITING}.
\Ticket{6525}

\item An IPv6 address can now be specified in the configuration file
either with or without square brackets in most cases.
If specifying a port number in the same value, the square brackets are
required.
If using a wildcard to specify a range of possible addresses, square
brackets are not allowed.
\Ticket{5697}

\item Improved support for IPv6 link-local addresses, in particular
using the correct scope id.
Using a wildcard or device name in \MacroNI{NETWORK\_INTERFACE} now
works properly when \MacroNI{NO\_DNS} is set to \Expr{True}.
\Ticket{6518}

\end{itemize}

\noindent Bugs Fixed:

\begin{itemize}

\item None.
\item IPv4 addresses are now ignored when resolving a hostname and
\MacroNI{ENABLE\_IPV4} is set to \Expr{False}.
\Ticket{4881}

\end{itemize}

Expand Down
14 changes: 1 addition & 13 deletions src/ccb/ccb_server.cpp
Expand Up @@ -469,19 +469,7 @@ CCBServer::HandleRegistration(int cmd,Stream *stream)
// potential flexibility on the CCB server side to do things like
// assign different targets to different CCB server sub-processes,
// each with their own command port.

//
// We need to reply with a contact string of the proper protocol. At
// some point, we'll just send /all/ of our command sockets, but for
// now, just use the rewriter (and lie to make sure it happens).
//
std::string exprString;
formatstr( exprString, "%s = \"<%s>\"", ATTR_MY_ADDRESS, m_address.Value() );
ConvertDefaultIPToSocketIP( ATTR_MY_ADDRESS, exprString, * stream );
std::string rewrittenAddress = exprString.substr( strlen( ATTR_MY_ADDRESS ) + 5 );
rewrittenAddress.resize( rewrittenAddress.size() - 2 );
dprintf( D_NETWORK | D_VERBOSE, "Will send %s instead of %s to CCB client %s.\n", rewrittenAddress.c_str(), m_address.Value(), sock->my_ip_str() );
CCBIDToContactString( rewrittenAddress.c_str(), target->getCCBID(), ccb_contact );
CCBIDToContactString( m_address.Value(), target->getCCBID(), ccb_contact );

CCBIDToString( reconnect_info->getReconnectCookie(),reconnect_cookie_str );

Expand Down
27 changes: 1 addition & 26 deletions src/classad/classad/lexer.h
Expand Up @@ -79,9 +79,7 @@ class Lexer
LEX_CLOSE_PAREN,
LEX_OPEN_BRACE,
LEX_CLOSE_BRACE,
LEX_BACKSLASH,
LEX_ABSOLUTE_TIME_VALUE,
LEX_RELATIVE_TIME_VALUE
LEX_BACKSLASH
};

class TokenValue
Expand All @@ -94,9 +92,6 @@ class Lexer
realValue = 0.0;
boolValue = false;
quotedExpr = false;
relative_secs = 0;
absolute_secs.secs = 0;
absolute_secs.offset = 0;
}

~TokenValue( ) {
Expand Down Expand Up @@ -127,14 +122,6 @@ class Lexer
quotedExpr = quoted;
}

void SetAbsTimeValue( abstime_t asecs ) {
absolute_secs = asecs;
}

void SetRelTimeValue( double rsecs ) {
relative_secs = rsecs;
}

TokenType GetTokenType( ) {
return tt;
}
Expand All @@ -160,23 +147,13 @@ class Lexer
quoted = quotedExpr;
}

void GetAbsTimeValue( abstime_t& asecs ) {
asecs = absolute_secs;
}

void GetRelTimeValue( double& rsecs ) {
rsecs = relative_secs;
}

void CopyFrom( TokenValue &tv ) {
tt = tv.tt;
factor = tv.factor;
intValue = tv.intValue;
realValue = tv.realValue;
boolValue = tv.boolValue;
quotedExpr = tv.quotedExpr;
relative_secs = tv.relative_secs;
absolute_secs = tv.absolute_secs;
strValue = tv.strValue;
}

Expand All @@ -188,8 +165,6 @@ class Lexer
bool boolValue;
bool quotedExpr;
std::string strValue;
double relative_secs;
abstime_t absolute_secs;
};

// ctor/dtor
Expand Down
4 changes: 0 additions & 4 deletions src/classad/lexer.cpp
Expand Up @@ -258,8 +258,6 @@ PeekToken (TokenValue *lvalp)
case LEX_CLOSE_PAREN:
case LEX_CLOSE_BRACE:
case LEX_BACKSLASH:
case LEX_ABSOLUTE_TIME_VALUE:
case LEX_RELATIVE_TIME_VALUE:
tokenizePunctOperator();
break;
default:
Expand Down Expand Up @@ -971,8 +969,6 @@ strLexToken (int tokenValue)
case LEX_OPEN_BRACE: return "LEX_OPEN_BRACE";
case LEX_CLOSE_BRACE: return "LEX_CLOSE_BRACE";
case LEX_BACKSLASH: return "LEX_BACKSLASH";
case LEX_ABSOLUTE_TIME_VALUE: return "LEX_ABSOLUTE_TIME_VALUE";
case LEX_RELATIVE_TIME_VALUE: return "LEX_RELATIVE_TIME_VALUE";

default:
return "** Unknown **";
Expand Down
23 changes: 0 additions & 23 deletions src/classad/source.cpp
Expand Up @@ -1091,29 +1091,6 @@ parsePrimaryExpression(ExprTree *&tree)
val.SetStringValue( s );
return( (tree=Literal::MakeLiteral(val)) != NULL );
}

case Lexer::LEX_ABSOLUTE_TIME_VALUE:
{
Value val;
abstime_t asecs;

tv.GetAbsTimeValue( asecs );
lexer.ConsumeToken( );
val.SetAbsoluteTimeValue( asecs );
return( (tree=Literal::MakeLiteral(val)) != NULL );
}

case Lexer::LEX_RELATIVE_TIME_VALUE:
{
Value val;
double secs;

tv.GetRelTimeValue( secs );
lexer.ConsumeToken( );
val.SetRelativeTimeValue( secs );
return( (tree=Literal::MakeLiteral(val)) != NULL );
}

default:
tree = NULL;
return false;
Expand Down
69 changes: 9 additions & 60 deletions src/condor_ckpt_server/network2.cpp
Expand Up @@ -57,6 +57,7 @@

#include "network2.h"
#include "internet.h"
#include "internet_obsolete.h"

#include <stdio.h>
#include <stdlib.h>
Expand All @@ -68,18 +69,6 @@
/* P R O T O T Y P E S */
char *param(void);

//char* GetIPName(struct in_addr machine_IP)
//{
// char* temp_name;
//
// temp_name = inet_ntoa(machine_IP);
// if (temp_name == NULL)
// return "<Unresolved IP>";
// else
// return temp_name;
//}


/******************************************************************************
* *
* Function: I_bind(int socket_desc, *
Expand Down Expand Up @@ -125,9 +114,15 @@ int I_bind(int socket_desc, condor_sockaddr& addr, int is_well_known)
priv_state old_priv = PRIV_UNKNOWN;

//temp = sizeof(struct sockaddr_in);
setsockopt(socket_desc, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
setsockopt(socket_desc, SOL_SOCKET, SO_LINGER,
int ret = setsockopt(socket_desc, SOL_SOCKET, SO_REUSEADDR, (char*)&on, sizeof(on));
if (ret < 0) {
fprintf(stderr, "\nWARNING: Cannot set SO_REUSEADDR on socket %d\n", socket_desc);
}
ret = setsockopt(socket_desc, SOL_SOCKET, SO_LINGER,
(char*)&linger, sizeof(linger));
if (ret < 0) {
fprintf(stderr, "\nWARNING: Cannot set SO_LINGER on socket %d\n", socket_desc);
}

// remember we did this transformation before calling this function...
// so undo it here.
Expand Down Expand Up @@ -190,52 +185,6 @@ int I_bind(int socket_desc, condor_sockaddr& addr, int is_well_known)



/******************************************************************************
* *
* Function: gethostnamebyaddr(struct in_addr* addr) *
* *
*******************************************************************************
* *
* This function, by using the gethostbyaddr() function, returns a pointer *
* to the name (i.e., string) of a machine. The machine is specified by *
* the parameter which is an IP address. *
* *
* Note: this function may fail if the name server cannot find the name of *
* a machine. In this case, this function will terminate the program. *
* *
*******************************************************************************
* *
* Parameters: *
* struct in_addr* addr - a pointer to an IP address *
* *
*******************************************************************************
* *
* Return Type: *
* char* - a pointer to a static area where a machine's (string) name *
* is held *
* *
******************************************************************************/


//char* gethostnamebyaddr(struct in_addr* addr)
//{
// struct hostent* h;
//
// h = condor_gethostbyaddr((char*)addr, sizeof(struct in_addr), AF_INET);
// if (h == NULL)
// {
// fprintf(stderr, "\nERROR:\n");
// fprintf(stderr, "ERROR:\n");
// fprintf(stderr, "ERROR: cannot get host information (pid=%d)\n",
// (int) getpid());
// fprintf(stderr, "ERROR:\n");
// fprintf(stderr, "ERROR:\n\n");
// return NULL;
// }
// return(h->h_name);
//}


/******************************************************************************
* *
* Function: I_socket(int exit_status) *
Expand Down
5 changes: 0 additions & 5 deletions src/condor_ckpt_server/network2.h
Expand Up @@ -64,15 +64,11 @@
#include "condor_sockaddr.h"

/* Function Prototypes*/
//extern "C" {
//char* GetIPName(struct in_addr machine_IP);

// I_bind binds to given addr and stores the address obtained by
// getsockname() on socket_desc to addr.
int I_bind(int socket_desc, condor_sockaddr& addr, int is_well_known);

//char* gethostnamebyaddr(struct in_addr* addr);

int I_socket(void);

int I_listen(int socket_desc, int queue_len);
Expand All @@ -81,7 +77,6 @@ int I_accept(int socket_desc,
condor_sockaddr& addr);

int net_write(int socket_desc, char* buffer, int size);
//}


#endif
Expand Down
1 change: 1 addition & 0 deletions src/condor_ckpt_server/server2.cpp
Expand Up @@ -925,6 +925,7 @@ void Server::ProcessServiceReq(int req_id,
service_reply.server_addr.s_addr = ntohl(server_addr.s_addr);
service_reply.port = server_sa.get_port();
close(data_conn_sd);
data_conn_sd = -1;
} else {
service_reply.server_addr.s_addr = 0;
service_reply.port = 0;
Expand Down
1 change: 1 addition & 0 deletions src/condor_ckpt_server/server_interface.cpp
Expand Up @@ -24,6 +24,7 @@
#include "constants2.h"
#include "network2.h"
#include "internet.h"
#include "internet_obsolete.h"
#include "condor_netdb.h"
#include "condor_sockaddr.h"
#include "ipv6_hostname.h"
Expand Down

0 comments on commit 643d3a8

Please sign in to comment.