Ben Pfaff [Wed, 10 Feb 2010 19:18:48 +0000 (11:18 -0800)]
ofproto: Avoid passing indeterminate value to rule_insert().
The 'in_port' argument to rule_insert() is only used if its 'packet'
argument is nonnull, so this is not, strictly speaking, a bug, but it
seems much cleaner.
The default -1 value of in_port matches what pktbuf_retrieve() stores
there on failure.
Ben Pfaff [Wed, 10 Feb 2010 19:04:30 +0000 (11:04 -0800)]
sflow: Don't assign value that is never used.
The "error" return from collectors_create() is actually not that
interesting, because there could still be some collectors configured
properly anyhow, so we might as well discard the error return here,
without even assigning it to a variable.
Ben Pfaff [Wed, 10 Feb 2010 18:51:11 +0000 (10:51 -0800)]
ovsdb: Add default case to ovsdb_mutation_set_execute().
The value of 'error' is indeterminate if m->mutator is not set to a valid
value here, so we should add a default case to handle the exception. It
shouldn't happen, of course.
Ben Pfaff [Thu, 11 Feb 2010 18:34:45 +0000 (10:34 -0800)]
netdev-linux: Avoid fiddling with indeterminate data.
If we are using netlink to get stats and get_ifindex() fails, then for
an internal network device we will then swap around a bunch of
indeterminate (uninitialized) data values. That won't hurt anything--the
caller will still set them to all-1-bits due to the error--but it still
seems wrong. So this commit avoid it.
Found using Clang (http://clang-analyzer.llvm.org/).
Ben Pfaff [Wed, 10 Feb 2010 19:13:09 +0000 (11:13 -0800)]
vswitch: Fix uninitialized variable.
The 'ip' variable in this inner "if" statement shadows a variable with
the same name in the enclosing block. The variable in the inner block
is never initialized.
Ben Pfaff [Wed, 10 Feb 2010 18:41:44 +0000 (10:41 -0800)]
ovs-brcompatd: Handle transaction errors slightly more gracefully.
It is not a good idea to just exit on an OVSDB transaction error.
TXN_TRY_AGAIN will definitely happen in practice; TXN_ERROR should not but
we should not just fail if it does.
Ben Pfaff [Tue, 9 Feb 2010 18:17:58 +0000 (10:17 -0800)]
ovsdb: Add support for multiple databases to the protocol.
This also adds protocol compatibility to the database itself and to
ovsdb-client. It doesn't actually add multiple database support to
ovsdb-server, since we don't really need that yet.
Ben Pfaff [Tue, 9 Feb 2010 19:17:16 +0000 (11:17 -0800)]
xenserver: Fix failure to bring up secondary management interfaces.
When a secondary management interface is configured on a XenServer,
interface-reconfigure would fail to bring it up because it would attempt
to add a bridge that already exists. This commit makes it tolerate that
situation.
Ben Pfaff [Tue, 9 Feb 2010 00:37:49 +0000 (16:37 -0800)]
ovsdb: Make scalars and 1-element sets interchangeable.
It is natural to write "abc" in place of ["set",["abc"]] and vice versa.
I cannot think of a reason not to support this, and it can make reading
and writing OVSDB files and transactions easier, so support it.
There is no value in saving a call to uuid_hash() in ovsdb_table_put_row(),
because uuid_hash() is a trivial inline function, so integrate
ovsdb_table_get_row__() into ovsdb_table_get_row() and simplify
ovsdb_table_put_row().
Ben Pfaff [Thu, 4 Feb 2010 19:47:32 +0000 (11:47 -0800)]
ovsdb: Use direct pointer from table to txn_table to simplify code.
Until now, when a transaction modified rows in a table, the metadata
associated with that table modification (in struct ovsdb_txn_table) had to
be looked up through a hash table. This made the code unnecessarily
complicated and had no benefit in itself, so this commit changes
struct ovsdb_table to have a direct pointer to its ovsdb_txn_table.
Ben Pfaff [Thu, 4 Feb 2010 22:34:01 +0000 (14:34 -0800)]
ovsdb: Fix result object for "declare" operation.
The "declare" operation is specified to return a <uuid>, e.g.:
["uuid", "7b703002-f7b6-45c6-bfd6-7619b21a1a5f"]
It was actually just returning the second part, e.g.
"7b703002-f7b6-45c6-bfd6-7619b21a1a5f"
This commit makes the result match the specification.
Jesse Gross [Mon, 1 Feb 2010 23:20:22 +0000 (18:20 -0500)]
vswitch: Consistently set Nicira OUI.
In places where a random Ethernet address needs to be generated we
are inconsistent about setting an OUI. This sets an OUI everywhere
to allow the source of packets to be easily identified.
Jesse Gross [Mon, 8 Feb 2010 19:52:20 +0000 (14:52 -0500)]
gre: Fix use after free in netns compatibility layer.
The newly updated network namespace compatibility layer contained
an issue in the pernet automatic storage allocation feature that
prematurely freed memory. This caused an OOPS if the module was
unloaded.
Jesse Gross [Tue, 2 Feb 2010 21:44:44 +0000 (16:44 -0500)]
gre: Unify IPTUNNEL_XMIT across kernel versions.
The IPTUNNEL_XMIT macro was split into different versions based on
the kernel. This adds the compatibility code to allow a single
copy to work on all kernel versions, making it easier to maintain.
Ben Pfaff [Tue, 2 Feb 2010 22:25:11 +0000 (14:25 -0800)]
ovs-vsctl: Use vsctl_fatal() consistently.
vsctl_fatal() logs its argument as well as printing it on stderr, so it
is preferable within ovs-vsctl. An upcoming commit will also make
vsctl_fatal() free memory, so using it consistently will also make that
memory freed consistently.
Ben Pfaff [Tue, 2 Feb 2010 22:16:06 +0000 (14:16 -0800)]
tests: Always make ovsdb-server exit cleanly, to better find memory leaks.
"ovs-appctl exit" causes a cleaner shutdown than "kill" and in particular
lets ovsdb-server clean up better, which makes it easier to find real
memory leaks.
Ben Pfaff [Tue, 2 Feb 2010 22:31:36 +0000 (14:31 -0800)]
tests: Fix timing dependency in ovsdb-log test.
The "lockfile" module logs a message if locking takes a measurable amount
of time. Running the tests under valgrind tends to make this message
appear, so we need to disable it to make the output comparison come out
cleanly.
Jesse Gross [Mon, 1 Feb 2010 21:43:44 +0000 (16:43 -0500)]
datapath: Set datapath device MTU to minimum of MTU of ports.
The MTU of the local port should be no larger than the minimum of
the MTUs of the ports attached to the bridge, overwise packets may be
dropped. We already prevent changes to the MTU that would violate
this constraint but don't actuallly proactively set the MTU. This
changes makes everything consistent and matches the behavior of
the bridge.
Jesse Gross [Fri, 29 Jan 2010 20:54:47 +0000 (15:54 -0500)]
xenserver: Add XenServer 5.5.0 updates 1 and 2 to supported versions.
Add the file hashes for updates 1 and 2 (the scripts we care about
are the same) to the list of supported versions to prevent a warning
message on install.
Ben Pfaff [Tue, 26 Jan 2010 19:35:38 +0000 (11:35 -0800)]
ofproto: Remove support for OpenFlow-based management protocol.
Older versions of Open vSwitch supported a management protocol based on
OpenFlow message framing. The current Open vSwitch instead uses the
OVSDB protocol for the same purposes. We don't plan to support this older
protocol any longer, so this commit deletes support.
This commit also deletes the management_id column from the vswitch's
database schema. The management_id was used by the older management
protocol to match up OpenFlow switch connections to management connections,
but the current implementation instead matches up connections based on
the datapath IDs exported by the configuration database. In fact, the
OpenFlow connections had no way to actually export the management ID, so
this just deletes code that was essentially without function anyhow.
Ian Campbell [Mon, 1 Feb 2010 17:50:14 +0000 (09:50 -0800)]
CA-37154: vswitch: Use MAC address of tagged PIF for VLAN fake-bridge
This is because PIF.MAC for a VLAN is FE:FF:FF:FF:FF:FF. In bridge
mode the VLAN and the bridge naturally pick up the underlying MAC
address from the physical device but under vswitch we must explicitly
specify it and we are currently specifying
FE:FF:FF:FF:FF. interface-reconfigure needs to use the MAC address of
the tagged PIF not the untagged PIF.
Jesse Gross [Fri, 29 Jan 2010 00:56:05 +0000 (19:56 -0500)]
netdev: Correctly maintain netdev refcounts even if errors occur.
If an error occured while opening a netdev it would decrement the
refcount, even though it was never incremented. Depending on
the timing this could result in either an error message or an
assertion failure. This workaround simply always increments
the refcount before openning a device. A more complete fix
already exists in the netdev overhaul in the 'next' branch.