Bug 1794923 - IPv6 IP:port handling in ovn-ctl
Summary: IPv6 IP:port handling in ovn-ctl
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: OVN
Version: RHEL 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Dumitru Ceara
QA Contact: Jianlin Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-25 13:47 UTC by Dan Winship
Modified: 2020-02-04 17:00 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-02-04 17:00:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan Winship 2020-01-25 13:47:01 UTC
in several places ovn-ctl joins an IP+port together by just concatenating them with a colon in between. This results in invalid syntax when using an IPv6 address:

    /usr/share/openvswitch/scripts/ovn-ctl --db-sb-cluster-local-port=9644 --db-sb-cluster-remote-port=9644 --db-sb-cluster-local-addr=fc00::7 --db-sb-cluster-remote-addr=fc00::4 --no-monitor --db-sb-cluster-local-proto=ssl --db-sb-cluster-remote-proto=ssl --ovn-sb-db-ssl-key=/ovn-cert/tls.key --ovn-sb-db-ssl-cert=/ovn-cert/tls.crt --ovn-sb-db-ssl-ca-cert=/ovn-ca/ca-bundle.crt '--ovn-sb-log=-vconsole:info -vfile:off' run_sb_ovsdb

    ovsdb-tool: ovsdb error: ssl:fc00::7:9644: syntax error in address

(It should be "ssl:[fc00::7]:9644".)


This applies at least to the lines:

        local local=$cluster_local_proto:$cluster_local_addr:\
$cluster_local_port
        local remote=$cluster_remote_proto:$cluster_remote_addr:\
$cluster_remote_port

I'm not sure if it also applies to:

        echo "$DB_NB_SYNC_FROM_PROTO:$DB_NB_SYNC_FROM_ADDR:$DB_NB_SYNC_FROM_PORT" > $ovnnb_active_conf_file

        echo "$DB_SB_SYNC_FROM_PROTO:$DB_SB_SYNC_FROM_ADDR:$DB_SB_SYNC_FROM_PORT" > $ovnsb_active_conf_file

        echo "$sync_from_proto:$sync_from_addr:\
$sync_from_port" > $active_conf_file

Comment 1 Dumitru Ceara 2020-01-29 16:15:04 UTC
Hi Dan,

To avoid ambiguity when dealing with IPv6 IP:port configurations, OVN (and OVS) expect the user to enclose the IPv6 address in square brackets. The same thing applies to ovn-ctl.

The command line from the BZ description should be updated to something like:

/usr/share/openvswitch/scripts/ovn-ctl --db-sb-cluster-local-port=9644 --db-sb-cluster-remote-port=9644 --db-sb-cluster-local-addr=[fc00::7] --db-sb-cluster-remote-addr=[fc00::4] --no-monitor --db-sb-cluster-local-proto=ssl --db-sb-cluster-remote-proto=ssl --ovn-sb-db-ssl-key=/ovn-cert/tls.key --ovn-sb-db-ssl-cert=/ovn-cert/tls.crt --ovn-sb-db-ssl-ca-cert=/ovn-ca/ca-bundle.crt '--ovn-sb-log=-vconsole:info -vfile:off' run_sb_ovsdb

Can you please confirm that it works properly when used like this?

Thanks,
Dumitru

Comment 2 Dan Winship 2020-02-04 13:17:30 UTC
ah, ok... That's a little weird; most things only expect IPv6 addresses to be enclosed in brackets when there is a port number attached to them. (And in fact, ovn-ctl only requires the brackets here because it's going to eventually attach a port number to those IPs.)

It does work if I manually add the brackets. Feel free to NOTABUG.

Comment 3 Dumitru Ceara 2020-02-04 17:00:34 UTC
(In reply to Dan Winship from comment #2)
> ah, ok... That's a little weird; most things only expect IPv6 addresses to
> be enclosed in brackets when there is a port number attached to them. (And
> in fact, ovn-ctl only requires the brackets here because it's going to
> eventually attach a port number to those IPs.)
> 
> It does work if I manually add the brackets. Feel free to NOTABUG.

Thanks for confirming.

It is a bit weird indeed and we could try to improve that in the future but from what I see we'd need some ugly shell script code to determine address family. It's probably more straight forward to pass the brackets from the CMS.

Thanks,
Dumitru


Note You need to log in before you can comment on or make changes to this bug.