openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

OVSDB remote URI(tcp:host[:port]) is reversed(tcp:port[:host]) in new --config-file #342

Closed legitYosal closed 3 weeks ago

legitYosal commented 3 weeks ago

Ok , Im deploying a relay server, using new --config-file option added in version 3.3.0, note the following config:

{
    "remotes": { "ptcp:172.25.3.1:16642": {
        "inactivity-probe": 60000
    } },
    "databases": {
        "OVN_Southbound": {
            "service-model": "relay",
            "source": {
                "tcp:172.25.3.1:6642": {
                    "inactivity-probe": 60000
                }
            }
        }
    }
}

Running ovsdb using this config file, shows an error on listening address:

$ ovsdb-server  --config-file=/etc/kolla/ovn-sb-db-relay/ovsdb-config-relay.json 
2024-09-23T16:09:18Z|00001|ovsdb_server|INFO|loading configuration from '/etc/kolla/ovn-sb-db-relay/ovsdb-config-relay.json'
2024-09-23T16:09:18Z|00002|socket_util|ERR|172.25.3.1:6642: bad port number "172.25.3.1"
2024-09-23T16:09:18Z|00003|ovsdb_server|INFO|ovsdb-server (Open vSwitch) 3.3.0
2024-09-23T16:09:18Z|00004|socket_util|ERR|172.25.3.1:6642: bad port number "172.25.3.1"
2024-09-23T16:09:18Z|00005|reconnect|INFO|ptcp:172.25.3.1:6642: listening...
2024-09-23T16:09:18Z|00006|reconnect|INFO|ptcp:172.25.3.1:6642: listen attempt failed (Address family not supported by protocol)
2024-09-23T16:09:18Z|00007|reconnect|INFO|tcp:172.25.0.1:6642: connecting...
2024-09-23T16:09:18Z|00008|reconnect|INFO|tcp:172.25.0.1:6642: connected
2024-09-23T16:09:19Z|00009|socket_util|ERR|172.25.3.1:6642: bad port number "172.25.3.1"
2024-09-23T16:09:19Z|00010|reconnect|INFO|ptcp:172.25.3.1:6642: listening...
2024-09-23T16:09:19Z|00011|reconnect|INFO|ptcp:172.25.3.1:6642: listen attempt failed (Address family not supported by protocol)
2024-09-23T16:09:19Z|00012|reconnect|INFO|ptcp:172.25.3.1:6642: waiting 2 seconds before trying to listen again

Now if you change the ptcp:172.25.3.1:16642 to ptcp:16642:172.25.3.1, every thing will work fine, and listening address will be 172.25.3.1:16642, It is very odd.

My question is that, is this the intended behavior or a bug? is it patched or not? and can I work on its patch?

@igsilya

igsilya commented 3 weeks ago

It is by design and not limited to the config file. It is the same in all other places in OVS and OVN where passive connection can be configured. Passive connections always have port before the IP, active connections have IP before the port. The reason is that you can skip the IP in the passive connection if you want to listen on all IPs, e.g. pssl:6644 will listen on any (IPv4?) address and port 6644.

legitYosal commented 3 weeks ago

Thank you for your quick response, Now I understand.