2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00
Commit Graph

16530 Commits

Author SHA1 Message Date
Ben Pfaff
a4c3463d02 ofproto-dpif-xlate: Improve log message.
Until now, the bridge name was at the end of the log message, after the
flow, which made it easy to miss.  This commit moves it before the flow
where it is easier to spot.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2018-08-09 15:57:30 -07:00
Ben Pfaff
e11f0c258d tests: Don't log to syslog during tests.
Until now, "make check" generated a huge amount of output to syslog.  This
commit suppresses it.

Acked-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-09 15:40:09 -07:00
Ben Pfaff
8aa88fadc4 Merge branch 'dpdk_merge' of https://github.com/istokes/ovs into HEAD 2018-08-08 16:08:01 -07:00
Ben Pfaff
187f7d60b1 unixctl: Style fix.
Reported-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Justin Pettit <jpettit@ovn.org>
2018-08-08 15:16:50 -07:00
Ben Pfaff
b2d9a9ef5a ofp-port: Drop of useless indirection in ofputil_pull_ofp14_port_stats().
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-08-08 22:06:21 +01:00
Ben Pfaff
7333c3b1ce ofp-port: Fix buffer overread parsing Intel custom statistics.
CC: Michal Weglicki <michalx.weglicki@intel.com>
Fixes: 971f4b394c ("netdev: Custom statistics.")
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9445
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-08-08 22:06:21 +01:00
Kevin Traynor
51c6a5a3c8 netdev-dpdk: Use hex for PCI vendor ID.
Match the prefix and formatting.

Fixes: 8a9562d21a ("dpif-netdev: Add DPDK netdev.")
Cc: pshelar@ovn.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-08-08 22:06:21 +01:00
Sugesh Chandran
7e1de65e8d netdev-dpdk: Fix failure to configure flow control at netdev-init.
Configuring flow control at ixgbe netdev-init is throwing error in port
start.

For eg: without this fix, user cannot configure flow control on ixgbe dpdk
port as below,

"
    ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk \
        options:dpdk-devargs=0000:05:00.1 options:rx-flow-ctrl=true
"

Instead,  it must be configured as two different commands,

"
    ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk \
               options:dpdk-devargs=0000:05:00.1
    ovs-vsctl set Interface dpdk0 options:rx-flow-ctrl=true
"

The DPDK ixgbe driver is now validating all the 'rte_eth_fc_conf' fields before
trying to configuring the dpdk ethdev. Hence OVS can no longer set the
'dont care' fields to just '0' as before. This commit make sure all the
'rte_eth_fc_conf' fields are populated with default values before the dev
init.

Also to avoid read error on unsupported ports, the flow control parameters
are now read only when user is trying to configure/update it.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-08-08 22:06:21 +01:00
Ilya Maximets
18e08953cf dpif-netdev: Fix zero length keys insertion to EMC.
'key.len' should be calculated before inserting to EMC, otherwise
resulting entry will match with any packet with the same hash.

CC: Yipeng Wang <yipeng1.wang@intel.com>
Fixes: 60d8ccae13 ("dpif-netdev: Add SMC cache after EMC cache")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
2018-08-08 22:06:21 +01:00
Aaron Conole
c3cc694b93 table: fix html buffer output
Prior to this commit, html output exhibits a doppler effect for
content by continually printing strings passed from
table_print_html_cell.

Fixes: cb139fa8b3 ("table: New function table_format() for formatting a table as a string.")
Cc: Ben Pfaff <blp@ovn.org>
Cc: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-08 11:18:07 -07:00
Aaron Conole
3562353e0e table: append newline when printing tables
With commit cb139fa8b3 ("table: New function table_format() for
formatting a table as a string.") a new mechanism for formatting
tables was introduced, and the table_print method was refactored to
use this.

During that refactor, calls to 'puts' were replaced with
'ds_put_cstr', and table print was changed to use 'fputs(...,
stdout)'.  Unfortunately, fputs() does not append a newline to the
string provided, and changes the output strings of, for example,
ovsdb-client dump to print all on one line.  This means
post-processing scripts that are chained after ovsdb-client would
either block indefinitely (if they don't detect EOF), or process the
entire bundle at once (rather than seeing each table on a separate
line).

Fixes: cb139fa8b3 ("table: New function table_format() for formatting a table as a string.")
Cc: Ben Pfaff <blp@ovn.org>
Cc: Jakub Sitnicki <jsitnicki@gmail.com>
Reported-by: Terry Wilson <twilson@redhat.com>
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=1608508
Signed-off-by: Aaron Conole <aconole@redhat.com>
Suggested-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Terry Wilson <twilson@redhat.com>
Tested-by: Terry Wilson <twilson@redhat.com>
2018-08-08 11:17:00 -07:00
Alin Gabriel Serdean
111b58cc79 ofctl: Fixup compare_flows function
In the case there was no sorting criteria the flows on Windows were being
rearranged because it was always returning zero.

Also check if there we need sorting to save a few cycles.

CC: Ben Pfaff <blp@ovn.org>
Co-authored-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-08 21:01:37 +03:00
Markos Chandras
b096fa42dd rhel: Use correct user in the logrotate configuration file
The /var/log/openvswitch directory is owned by the openvswitch user but
logrotate could be running as root or as another user. As a result of
which, rpmlint prints the following warning when building the spec file
on SUSE Linux Enterprise:

openvswitch.x86_64: W: suse-logrotate-user-writable-log-dir /var/log/openvswitch openvswitch:openvswitch 0750
The log directory is writable by unprivileged users. Please fix the
permissions so only root can write there or add the 'su' option
to your logrotate config

In order to fix that, we should run the logrotate script as the same
user which runs the various Open vSwitch daemons. If this is a new
installation, then this user is the 'openvswitch' one, but if we are
upgrading from an older release, then the user is normally 'root'.
As such, we set the initial user to 'root' and we fix this up in the
%post scriptlet.

Cc: Aaron Conole <aconole@redhat.com>
Cc: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Markos Chandras <mchandras@suse.de>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Timothy Redaelli <tredaelli@redhat.com>
2018-08-08 10:58:05 -07:00
Justin Pettit
52e20a3d6c datapath: meter: Fix setting meter id for new entries
Upstream commit:
    From: Justin Pettit <jpettit@ovn.org>
    Date: Sat, 28 Jul 2018 15:26:01 -0700
    Subject: [PATCH] openvswitch: meter: Fix setting meter id for new entries

    The meter code would create an entry for each new meter.  However, it
    would not set the meter id in the new entry, so every meter would appear
    to have a meter id of zero.  This commit properly sets the meter id when
    adding the entry.

    Fixes: 96fbc13d7e77 ("openvswitch: Add meter infrastructure")
    Signed-off-by: Justin Pettit <jpettit@ovn.org>
    Cc: Andy Zhou <azhou@ovn.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: Justin Pettit <jpettit@ovn.org>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 16:53:55 -07:00
Han Zhou
769e6223da ovn-controller: Use ovsdb index for mac-binding update.
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 15:47:10 -07:00
Han Zhou
fdf541d482 ovn-trace: Fix warnings when port is found but not in current datapath.
When port group is used, ovn-trace may print warnings like this:

$ ovn-trace ls1 'inport == "lp111" && eth.src == f0:00:00:00:01:11 && eth.dst == f0:00:00:00:01:12  && ip4.src == 192.168.11.1 && ip4.dst == 192.168.11.2 && ip.ttl == 10'
2018-08-02T01:43:23Z|00001|ovntrace|WARN|lp211: not in datapath ls1
2018-08-02T01:43:23Z|00002|ovntrace|WARN|lp211: unknown logical port
2018-08-02T01:43:23Z|00003|ovntrace|WARN|lp221: not in datapath ls1
2018-08-02T01:43:23Z|00004|ovntrace|WARN|lp221: unknown logical port
2018-08-02T01:43:23Z|00005|ovntrace|WARN|lp231: not in datapath ls1
2018-08-02T01:43:23Z|00006|ovntrace|WARN|lp231: unknown logical port

There are 2 warnings:

For the first one, it might be reasonable
before port group is supported, but now since ports in a port group
can span across multiple datapaths, this situation is normal, and
warning should not be printed.

For the second one, it is misleading, and it should not be printed
in this situation even before port group is supported. It should be
printed only if the port is not found at all.

This patch fixes both.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 15:19:13 -07:00
Han Zhou
5cf668728a ovn-northd: Improve efficiency of stateful checking for ACLs on port groups.
Currently in has_stateful_acl(), to check if a datapath has stateful ACLs,
it needs to iterate all port groups and check if the current datapath is
related to each port group, and then iterate the ACLs on the port group. This
is inefficient if there are a lot of port groups. A typical scenario is in
OpenStack each tenant will have a default security group which will be mapped
as a port group, and the default security group is supposed to contain ports
of the tenant only, so most likely only the logical switches belonging to the
tenant should be related to the port group, but we are checking all the port
groups belonging to all tenants for each datapath.

To improve this, a reverse direction of hmap is built from logical switch to
port group, so that the iteration is avoided. The time complexity of this
function improves from O(P * A) to O(PL * A), P = total number of port groups
in NB, PL = number of port groups related to the logical switch, A = number
of ACLs.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 15:19:09 -07:00
Han Zhou
1fba38f168 ovn-northd: Simplify struct ovn_port_group.
Remove the redundant members that's already in nb_pg.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 15:16:40 -07:00
wenxu
e2e11c890e datapath: support upstream ndo_udp_tunnel_add in net_device_ops
It makes datapath can support both ndo_add_udp_tunnel_port and
ndo_add_vxlan/geneve_port. The newer kernels don't support vxlan/geneve
specific NDO's anymore

Signed-off-by: wenxu <wenxu@ucloud.cn>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Greg Rose <gvrose8192@gmail.com>
Tested-by: Greg Rose <gvrose8192@gmail.com>
2018-08-07 15:06:32 -07:00
YueHaibing
274e04f982 ip_gre: remove redundant variables t_hlen
Upstream commit:
    From: YueHaibing <yuehaibing@huawei.com>
    Date: Wed, 1 Aug 2018 10:04:02 +0800
    Subject: [PATCH] ip_gre: remove redundant variables t_hlen

    After commit ffc2b6ee4174 ("ip_gre: fix IFLA_MTU ignored on NEWLINK")
    variable t_hlen is assigned values that are never read,
    hence they are redundant and can be removed.

    Signed-off-by: YueHaibing <yuehaibing@huawei.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 15:04:58 -07:00
Xin Long
f689fe1e97 ip_gre: fix IFLA_MTU ignored on NEWLINK
Upstream commit:
    From: Xin Long <lucien.xin@gmail.com>
    Date: Tue, 27 Feb 2018 19:19:39 +0800
    Subject: [PATCH] ip_gre: fix IFLA_MTU ignored on NEWLINK

    It's safe to remove the setting of dev's needed_headroom and mtu in
    __gre_tunnel_init, as discussed in [1], ip_tunnel_newlink can do it
    properly.

    Now Eric noticed that it could cover the mtu value set in do_setlink
    when creating a ip_gre dev. It makes IFLA_MTU param not take effect.

    So this patch is to remove them to make IFLA_MTU work, as in other
    ipv4 tunnels.

      [1]: https://patchwork.ozlabs.org/patch/823504/

    Fixes: c54419321455 ("GRE: Refactor GRE tunneling code.")
    Reported-by: Eric Garver <e@erig.me>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Part of this commit already made it into __gre_tunnel_init but
the piece for erspan_tunnel_init did not make it in so fix that
now.

Cc: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 15:04:57 -07:00
Ben Pfaff
f0b8971ab9 tests: Ignore recirc_id in "MPLS xlate action" test.
When I run this test with DPDK enabled, it fails because it ends up using
a different recirculation ID when DPDK is not enabled.  I guess that's a
little weird but the recirculation IDs are not supposed to be significant,
so this change makes the test ignore it.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
Acked-by: Aaron Conole <aconole@redhat.com>
2018-08-07 15:02:21 -07:00
Ben Pfaff
70c5afb0e5 dns-resolve: Only ask unbound to read /etc/resolv.conf if it exists.
The unbound library complains if we ask it to read /etc/resolv.conf but
that file doesn't exist.  It's better to just skip reading it in that case.

Reported-by: Flavio Leitner <fbl@sysclose.org>
Reporetd-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-August/350751.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Flavio Leitner <fbl@sysclose.org>
2018-08-07 14:38:37 -07:00
Ben Pfaff
7c98d261fa AUTHORS: Add Zak Whittington.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 14:34:44 -07:00
Zak Whittington
f89547e2c8 ofproto-dpif-xlate: use new info-level logging helper when sending out an in_port
Added new helper function similar to xlate_report_error called
xlate_report_info that logs info-level messages, and used that
function to add an extra log message when attempting to send
out an in-port.

VMware-BZ: 2158607
Signed-off-by: Zak Whittington <zwhitt.vmware@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 14:23:47 -07:00
Ben Pfaff
7e5f6b1e16 ovn-nbctl: Make daemon mode more transparent.
This makes ovn-nbctl transparently use daemon mode if an appropriate
environment variable is set.

It also transforms ovn-nbctl.at so that it runs each ovn-nbctl test in
"direct" mode and in daemon mode.  It uses a combination of m4 macros and
shell functions to keep from expanding the generated testsuite more than
necessary.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 12:26:31 -07:00
Ben Pfaff
1830add688 ovn-nbctl: Separate command-line options parsing and interpretation.
This will allow selected options to be interpreted locally and others to
be passed to the daemon, when the daemon is in use.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 12:26:25 -07:00
Ben Pfaff
295fc4d609 unixctl: Make path to unixctl_server socket available to the client.
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-07 12:26:20 -07:00
Ben Pfaff
a521491bc5 raft: Fix use-after-free error in raft_store_snapshot().
raft_store_snapshot() constructs a new snapshot in a local variable then
destroys the current snapshot and replaces it by the new one.  Until now,
it has not cloned the data in the new snapshot until it did the
replacement.  This led to the unexpected consequence that, if 'servers' in
the old and new snapshots was the same, then it would first be freed and
later cloned, which could cause a segfault.

Multiple people reported the crash.  Gurucharan Shetty provided a
reproduction case.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-07 12:13:17 -07:00
Ben Pfaff
edbf9f5d43 AUTHORS: Add Bala Sankaran.
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 16:59:32 -07:00
Bala Sankaran
a9e5ac0f97 checkpatch: warn on possible bare return
void functions do not need to have a return statement, because
such statements are redundant. Warn the user of such instances.

An interim line check is added to allow gathering additional
context for each line that is being processed.

Signed-off-by: Bala Sankaran <bsankara@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 16:56:51 -07:00
Ilya Maximets
a3241d3ae3 ovs-vtep: Pass log level arguments to underlying utils.
Control utils should be called with the same verbose level
at least to manage output to system logs. For example, to
disable unwanted syslog messages in unit tests or to enable
higher debug levels if needed.
New arguments added before '-vconsole:off' because it's
still inconvenient to have console output.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 16:49:42 -07:00
Flavio Leitner
b3d7debaab json: Use unnamed embedded union.
Otherwise the code does not build.

Fixes: fa37affad3 ("Embrace anonymous unions.")
Signed-off-by: Flavio Leitner <fbl@sysclose.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 16:46:37 -07:00
Ashish Varma
ba35931267 tests: Test for ovs-ofctl snoop command
Added test for snoop command to check for the initial handshake messages
when a bridge connects to a controller via 'unix' connection method.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 16:44:45 -07:00
Ben Pfaff
ce67928088 stream-ssl: Define SSL_OP_NO_SSL_MASK for OpenSSL versions that lack it.
10 of the travis builds are failing such as
TESTSUITE=1 KERNEL=3.16.54 for gcc and clang.

Fixes: ab16d2c287 ("stream-ssl: Don't enable new TLS versions by default")
CC: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Han Zhou <hzhou8@ebay.com>
Acked-by: Darrell Ball <dlu998@gmail.com>
2018-08-06 16:27:06 -07:00
Timothy Redaelli
89caad6a23 utilities: Launch ovsdb-tool without using PAM
When ovsdb-server is starting, it performs some DB steps such as
creating and upgrading the OvS DB. When we are running as
'non-root' user, the 'runuser' tool is used to manage the privileges.
However, when this happens during systemd boot, we observe the following
errors in journald:

Jun 21 07:32:57 virt systemd[1]: session-c1.scope: Failed to add PIDs to
scope's control group: No such process
Jun 21 07:32:57 virt systemd[1]: Failed to start Session c1 of user openvswitch.
Jun 21 07:32:57 virt systemd[1]: session-c1.scope: Unit entered failed state.

According to the analysis performed on openSUSE bugzilla[1], it seems
that ovsdb-server.service creates (via the call to runuser) a user
session and therefore call pam_systemd which in its turn tries to start
a systemd user instance: "user@474.service". However "user@474.service"
is supposed to be started after systemd-user-sessions.service which is
supposed to be started after network.target. Additionally,
ovsdb-server.service uses Before=network.target hence the deadlock.

This commit uses "setpriv" instead of "runuser" to launch "ovsdb-tool" that
doesn't use PAM and so it permits to launch "ovsdb-tool" as a user without
having the deadlock. Since some old versions for "setpriv" (such as the
one used by RHEL7) doesn't support the username / groupname, but only the
user ids / group ids, "id" is used to get the user ID and the group IDs.
To replicate the same behaviour of "runuser", the effective group ID of
the user is used as GID (usually "openvswitch") and the remaining group
IDs are used as supplementary groups (usually "hugetlbfs", if OVS is
built with DPDK support).

[1]: https://bugzilla.suse.com/show_bug.cgi?id=1098630
Reported-by: Markos Chandras <mchandras@suse.de>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-July/349716.html
Co-authored-by: Aaron Conole <aconole@redhat.com>
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
2018-08-06 15:19:31 -07:00
Ben Pfaff
4111c9304d ovs-ofctl: Better validate OpenFlow message length in "ofp-parse-pcap".
Reported-by: Oscar Wilde <xdxiaobin@gmail.com>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2018-July/047070.html
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
2018-08-06 15:17:05 -07:00
Timothy Redaelli
fc38b9e2ba rhel: Add gcc and gcc-c++ to BuildRequires
Starting from Fedora 29, gcc and gcc-c++ won't be installed by default in
buildroot and so it's necessary to specify them explicitly in the spec file.

https://fedoraproject.org/wiki/Changes/Remove_GCC_from_BuildRoot

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 14:58:22 -07:00
Darrell Ball
2f15f8f313 dpctl: Simplify dpctl_flush_conntrack.
The function dpctl_flush_conntrack() and other such new functions with
multiple optional arguments can be simplified by reodering the checks
for optional parameters, where the datapath argument is checked for
last.

Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-06 14:47:14 -07:00
Timothy Redaelli
1ea9742269 utilities: Install ovs-tcp{dump, undump} also when only Python3 is enabled
Since commit 793bdb6c05 ("ovs-tcpdump: Fix incompatibilities with python3")
and commit 227abb77d3 ("ovs-tcpundump: Fix incompatibilities with python3")
ovs-tcpdump and ovs-tcpdump works with Python3 as well.

This commit allows ovs-tcpdump and ovs-tcpundump to be installed also when
only Python3 is enabled.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-04 19:19:00 -07:00
Darrell Ball
eb739be2ec db-ctl-base: Fix build with gcc 7.3 with O3.
Signed-off-by: Darrell Ball <dlu998@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-03 17:37:05 -07:00
Timothy Redaelli
ab16d2c287 stream-ssl: Don't enable new TLS versions by default
Currently protocol_flags is populated by the list of SSL and TLS
protocols by hand. This means that when a new TLS version is added to
openssl (in this case TLS v1.3 is added to openssl 1.1.1 beta)
ovsdb-server automatically enable support to it with the default ciphers.
This can be a security problem (since other ciphers can be enabled) and it
also makes a test (SSL db: implementation) to fail.

This commit changes the 'protocol_flags' to use the list of all protocol
flags as provided by openssl library (SSL_OP_NO_SSL_MASK) so there is no
need to keep the list updated by hand.

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-03 17:08:28 -07:00
Timothy Redaelli
49c5ee21ea utilities: don't use a bashism to check that datapath exists
[[ ]] syntax is not supported, at least, by dash that Debian, Ubuntu and other
linux distributions may use instead of bash.

This commit uses, instead, a POSIX way that is compatible with any POSIX
shell (bash, dash, busybox sh, etc).

CC: Martin Xu <martinxu9.ovs@gmail.com>
Fixes: 9763d17fbd ("utilities: check datapath exists before conntrack flush")
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Aaron Conole <aconole@redhat.com>
2018-08-03 17:06:56 -07:00
Ben Pfaff
2f7662a10e pcap-file: Fix formatting of log message.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
2018-08-03 16:55:20 -07:00
Ben Pfaff
c5358a967a meta-flow: Make mf_vl_mff_mf_from_nxm_header() require a valid field.
All the users of mf_vl_mff_mf_from_nxm_header() expect it to always obtain
a valid field or to report an error.  In practice, it did not report an
error in the case where the field was unknown (although it did report an
error in some other cases).  This commit fixes the problem.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9652
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
2018-08-03 16:53:51 -07:00
Ben Pfaff
6c8dd8caaf ovsdb-cluster: Add comment to test.
I thought I had added this while revising a previous patch but oops.

Fixes: 7ee9c6e034 ("tests: Fix cluster torture test.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
2018-08-03 16:40:20 -07:00
Ben Pfaff
c2d71875f2 ovsdb-tool: Only check leader completeness when we can, in "check-cluster".
Generally when we know the leader for a term, in "check-cluster", it's
because we read that leader's log file.  In that case, we have the leader's
log_end because it told us.  However, taking a snapshot can discard that
data.  In that case, log_end is 0 and we should not try to check for leader
completeness on that basis.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-03 16:24:48 -07:00
Ben Pfaff
7073a83fc7 ovsdb-tool: Check for duplicate server IDs in "check-cluster".
The user shouldn't provide a given server's log more than once but this
check makes sure.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-03 16:24:41 -07:00
Ben Pfaff
6bf2e3f644 ovsdb-tool: Read server headers first, before full logs, in "check-cluster".
Having the headers available before reading the complete logs means that
server IDs can be associated with the server file names earlier, which can
improve error messages in some cases.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-03 16:24:38 -07:00
Ben Pfaff
6233b87dbb ovsdb-tool: Fix logic for displaying server names in "check-cluster".
Without this patch, server names are displayed as UUIDs even when we know
the file name; file names are easier for the user to read.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mark Michelson <mmichels@redhat.com>
2018-08-03 16:24:36 -07:00