ovs-ofctl: Fix indentation in manpage.

This .RE (to reduce the current indentation level) needs to go after all
the actions, but it was mistakenly put before the fin_timeout action.

Reported-by: Paul Ingram <paul@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
tests: Fix sensitivity to record ordering in test-netflow output.

The order of records in a NetFlow message is essentially random, but the
test case was picky about it.  I started getting failures when I modified
apparently unrelated code, so here's a fix.

Signed-off-by: Ben Pfaff <blp@nicira.com>
stream-unix: Reduce connection failure log level from ERR to WARN.

Sometimes this just means that the daemon we're connecting to is
restarting.

Bug #13177.
Reported-by: Scott Hendricks <shendricks@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: Add version info for out-of-tree modules.

The upstream version of the module always has the version of the running kernel
but for out-of-tree modules it can be difficult to tell the current version.
This adds the information to the module where it can be read using modinfo for
the on-disk version or from /sys/module/openvswitch/version for the currently
loaded module.

Suggested-by: Duffie Cooley <dcooley@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
FAQ: Describe difference between ovs-dpctl and ovs-ofctl "dump-flows".

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
jsonrpc: Fix Python implementation of inactivity logic.

When a JSON-RPC session receives bytes, or when it successfully sends
queued bytes, then it should count that as activity.  However, the code
here was reversed, in that it used the wrong check in each place.  That is,
when it tried to receive data, it would check whether data had just been
sent, and when it tried to send data, it would check whether data had just
been received.  Neither one makes sense and doesn't work.

Bug #13214.
Reported-by: Luca Giraudo <lgiraudo@nicira.com>
CC: James Schmidt <jschmidt@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath: Remove unecessary semicolon

Found by http://coccinelle.lip6.fr/

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
ofp-actions: Improve explanation of 'compat' member in struct ofpact.

Suggested-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Accept port keywords, OF1.1 port numbers, reject port number 0.

OpenFlow 1.0 has special reserved ports in the range 0xfff8 to 0xffff.
OpenFlow 1.1 and later has the same ports in the range 0xfffffff8 to
0xffffffff and allows the OF1.0 range to be used for ordinary ("physical")
switch ports.  This means that, naively, the meaning of a port number in
the range 0xfff8 to 0xffff given on the ovs-ofctl command line depends on
the protocol in use.  This commit implements something a little smarter:

    - Accept keyword names (e.g. LOCAL) for special reserved ports
      everywhere that such a port can plausibly be used (previously they
      were only accepted in some places).

    - Translate 0xfff8...0xffff to 0xfffffff8...0xffffffff for now, since
      OF1.1+ isn't in widespread use and those particular ports aren't
      likely to be in use in OF1.1+ anyway.

    - Log warnings about those ports when they are specified by number, to
      allow users to fix their invocations.

Also:

    - Accept the OF1.1+ port numbers for these ports, without warning, for
      compatibility with the upcoming OF1.1+ support.

    - Stop accepting port number 0, which has never been a valid port
      number in OpenFlow 1.0 and later.  (This required fixing some tests
      that inadvertently used this port number).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Simon Horman <horms@verge.net.au>
bridge: Omit alerts on the cfm_remote_opstate column.

This column should be write only, otherwise every call to update it
has to make a trip to the database.  Since this column is updated
every time through the run loop as part of refresh_instant_stats(),
this patch fixes a significant performance degradation.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
ofproto: Fix uninitialized field in ofputil_flow_update.

Two instances of ofputil_flow_update had the priority field uninitialized.
This would cause flow updates to contain undefined priority values.

This bug was introduced by commit 81a76618 (classifier: Break cls_rule
'flow' and 'wc' members into new "struct match".)

Signed-off-by: Anupam Chanda <achanda@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
flow: Only show IPv4 flow information for IPv4 flows

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
unixctl: Fix comment on unixctl_command_register().

The arguments to the callback were changed some time ago but the comment
still described the older form.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-tool: Fix indentation in manpage.

This paragraph is about show-log so it should be indented the same as the
other paragraph about show-log.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovs-lib: Move DAEMON_CWD initialization to top of file.

All the other variables are initialized at the top and I don't see a reason
that this variable is special.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-client: Use svec instead of sset for list of database.

This will make it easier to print a list of databases in sorted order,
which will happen in a followup commit.

This commit should have no effect on visible OVS behavior.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-client: Make "list-dbs" print the list of databases in sorted order.

This makes the command's behavior more predictable when there is more than
one database.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-server: Fix null pointer deref when bool "is_connected" is empty.

The ovsdb-server supports obtaining its remote connection targets from a
database table and updating that table with connection status information.
One of the supported connection status columns is a boolean column named
"is_connected".  The code in ovsdb-server blindly assigned a bool into
this column without checking that it actually had space allocated for one.
This was and is fine with the ovs-vswitchd schema, which always has exactly
one value in this column.  However, if a database schema makes this column
optional, and there are actually no values in it, then this assignment
dereferences a null pointer.

This commit fixes the problem by allocating space for a bool if none has
yet been allocated.

Noticed while adding an extra test for the connection status feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-server: Add --enable-dummy option for unit tests.

This will allow an upcoming unit test to use the "time/warp" ovs-appctl
command with ovsdb-server.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ovsdb-server: Add support for multiple databases.

The OVSDB protocol has supported multiple databases for a long time, but
the ovsdb-server implementation only supported one database at a time.
This commit adds support for multiple databases.

Feature #12353.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>