From: Attila Molnar Date: Wed, 16 Nov 2016 10:58:03 +0000 (+0100) Subject: Merge pull request #1234 from SaberUK/master+config2 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=8189eb162eeef6a080bee90b6d6bac119ce4739c;hp=25f2f7f3e8e04ecb341aab7d75dfda6724670eda;p=user%2Fhenk%2Fcode%2Finspircd.git Merge pull request #1234 from SaberUK/master+config2 Rework the example services aliases. --- diff --git a/docs/conf/helpop-full.conf.example b/docs/conf/helpop-full.conf.example index d8af395ad..a1e3c881a 100644 --- a/docs/conf/helpop-full.conf.example +++ b/docs/conf/helpop-full.conf.example @@ -410,7 +410,7 @@ This command returns the number of local and global clients matched, and the percentage of clients matched, plus how they were matched (by IP address or by hostname)."> - diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index 3f545e567..79a127d5a 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -152,10 +152,13 @@ # to this bind section. type="clients" - # ssl: If you want the port(s) in this bind tag to use SSL, set this - # to either "gnutls" or "openssl". The appropriate SSL module must be - # loaded for SSL to work. If you do not want the port(s) in this bind - # tag to support SSL, just remove or comment out this option. + # ssl: If you want the port(s) in this bind tag to use SSL, set this to + # the name of a custom tag that you have defined or one + # of "openssl", "gnutls", "mbedtls" if you have not defined any. See the + # wiki page for the SSL module you are using for more details. + # + # You will need to load the ssl_openssl module for OpenSSL, ssl_gnutls + # for GnuTLS and ssl_mbedtls for mbedTLS. ssl="gnutls" # defer: When this is non-zero, connections will not be handed over to @@ -168,6 +171,12 @@ # To change it on a running bind, you'll have to comment it out, # rehash, comment it in and rehash again. defer="0" + + # free: When this is enabled the listener will be created regardless of + # whether the interface that provides the bind address is available. This + # is useful for if you are starting InspIRCd on boot when the server may + # not have brought the network interfaces up yet. + free="no" > @@ -177,11 +186,19 @@ # module). # -# When linking servers, the OpenSSL and GnuTLS implementations are completely -# link-compatible and can be used alongside each other -# on each end of the link without any significant issues. -# Supported SSL types are: "openssl" and "gnutls". -# You must load the ssl_openssl module for OpenSSL or ssl_gnutls for GnuTLS. +# You can define a custom tag which defines the SSL configuration +# for this listener. See the wiki page for the SSL module you are using for +# more details. +# +# Alternatively, you can use one of the default SSL profiles which are created +# when you have not defined any: +# "openssl" (requires the ssl_openssl module) +# "gnutls" (requires the ssl_gnutls module) +# "mbedtls" (requires the ssl_mbedtls module) +# +# When linking servers, the OpenSSL, GnuTLS, and mbedTLS implementations are +# completely link-compatible and can be used alongside each other on each end +# of the link without any significant issues. @@ -301,9 +318,9 @@ # \017 or \x = Stop all color sequences allowmotdcolors="false" - # port: What port this user is allowed to connect on. (optional) - # The port MUST be set to listen in the bind blocks above. - port="6697"> + # port: What port range this user is allowed to connect on. (optional) + # The ports MUST be set to listen in the bind blocks above. + port="6697,9999"> tag that you have defined or one of "openssl", "gnutls", + # "mbedtls" if you have not defined any. See the wiki page for the SSL + # module you are using for more details. # - # You will need to load the ssl_openssl module for OpenSSL, - # or ssl_gnutls for GnuTLS. The server port that you connect to - # must be capable of accepting this type of connection. + # You will need to load the ssl_openssl module for OpenSSL, ssl_gnutls + # for GnuTLS and ssl_mbedtls for mbedTLS. The server port that you + # connect to must be capable of accepting this type of connection. ssl="gnutls" # fingerprint: If defined, this option will force servers to be diff --git a/src/listensocket.cpp b/src/listensocket.cpp index 13aebf75f..d09f5e624 100644 --- a/src/listensocket.cpp +++ b/src/listensocket.cpp @@ -54,6 +54,20 @@ ListenSocket::ListenSocket(ConfigTag* tag, const irc::sockets::sockaddrs& bind_t } #endif + if (tag->getBool("free")) + { + socklen_t enable = 1; +#if defined IP_FREEBIND // Linux 2.4+ + setsockopt(fd, SOL_IP, IP_FREEBIND, &enable, sizeof(enable)); +#elif defined IP_BINDANY // FreeBSD + setsockopt(fd, IPPROTO_IP, IP_BINDANY, &enable, sizeof(enable)); +#elif defined SO_BINDANY // NetBSD/OpenBSD + setsockopt(fd, SOL_SOCKET, SO_BINDANY, &enable, sizeof(enable)); +#else + (void)enable; +#endif + } + SocketEngine::SetReuse(fd); int rv = SocketEngine::Bind(this->fd, bind_to); if (rv >= 0)