lib/ovs-rcu: evaluate argument of ovsrcu_get only once.

As ovsrcu_get() looks like a function call, it is reasonable for the
callers to expect that the arguments are evaluated only once.
CONST_CAST expands its 'POINTER' argument multiple times, and the
exact effect of this turned out to be compiler dependent.  Fix this by
expanding the macro argument before CONST_CAST, and removing
unnecessary CONST_CASTs.

VMware-BZ: #1287651

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ovs-atomic: Avoid evaluating arguments multiple times.

ovs-atomic-gcc4+ did expand arguments again, if locked set/get was
called.

Also fix atomic_is_lock_free().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
vswitchd/bridge: Fix setting default prefix fields.

The check for the need of default values was in the wrong place,
causing no prefix tracking to be used when database had no
configuration for a flow table.  Missing configuration means that
defaults should be used.

To limit clutter on the log, we now log the prefix tracking
configuration when it is explicitly set in the database.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
cmap, classifier: Avoid unsafe aliasing in iterators.

CMAP_FOR_EACH and CLS_FOR_EACH and their variants tried to use void ** as
a "pointer to any kind of pointer".  That is a violation of the aliasing
rules in ISO C which technically yields undefined behavior.  With GCC 4.1,
it causes both warnings and actual misbehavior.  One option would to add
-fno-strict-aliasing to the compiler flags, but that would only help with
GCC; who knows whether this can be worked around with other compilers.

Instead, this commit rewrites the iterators to avoid disallowed pointer
aliasing.

VMware-BZ: #1287651
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
classifier: Refactor cls_cursor_advance() to make it easier to follow.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
tests: Wait for ofctl_monitor.log in ofproto-dpif controller.

Fixes a race in the test case.

Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
RSTP implementation core files (IEEE 802.1D)
RSTP interaction with OVS, documentation and tests.
rstp: Fix MAC learning tables flushing.
rstp: Fixed rstp BPDU padding. Removed unused code in tx_rstp(), tx_config(), tx_tcn().
ofproto-dpif: Fix segfault removing port when RSTP is enabled.

Reported-by: Sridhar Samudrala <samudrala.sridhar@gmail.com>
Update NOTICE
rstp: Remove unnecessary includes of SSL_LIBS.
rstp: add missing SLOW_RSTP in compose_slow_path()
rstp: Fix bpdu tx problem in learning state
rstp: Fix stp and rstp coexistence in handling bpdus
rstp: enable RSTP_DISCARDING state to send bpdus
rstp: Fix required by patch struct ofpbuf modifications.
rstp: adapt to new ofpbuf api, link test-rstp into ovstest.
rstp: replace white spaces with tabs in lib/automake.mk.