Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-9309

Wrong interpretation of Config.getOutboundBindAny depending on using SSL or not

    XMLWordPrintableJSON

Details

    • Normal

    Description

      In function OutboundTcpConnectionPool.newSocket(), it appears the binding behavior of client sockets is different depending on the encryption setting.

      If encryption is enabled, and Config.getOutboundBindAny() is true, then no address is passed to SSLFactory.getSocket (so I assume it binds to any address).

      If encryption is enabled, and Config.getOutboundBindAny() is false, then FBUtilities.getLocalAddress() is passed to SSLFactory.getSocket (so I assume the new socket will be bound to that address).

      If encryption is disabled, and Config.getOutboundBindAny() is true (and socket.isBound() returns false) then the socket is bound to FBUtilities.getLocalAddress().

      If encryption is disabled, and Config.getOutboundBindAny() is false, the socket is not bound.

      The case of encryption disabled appears to be wrong, and the Config.getOutboundBindAny() flag gets inverted depending on the encryption setting. Shouldn't

      if (Config.getOutboundBindAny() && !socket.isBound())
      

      be this:

      if (!Config.getOutboundBindAny() && !socket.isBound())
      

      This is in my copy of the 2.0.11 tag, and appears to be the same in trunk.

      Attachments

        Activity

          People

            yukim Yuki Morishita
            csmlyve Casey Marshall
            Yuki Morishita
            Robert Stupp
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: