flow: Set ttl in flow_compose().

Thanks to Ben Pfaff for immediately pinpointing the likely location of
the issue.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
(cherry picked from commit aabf5352bbf7e6fdc3d8da9f7f0b2e268da6ea68)
Signed-off-by: Simon Horman <horms@verge.net.au>

Conflicts:
	tests/ofproto-dpif.at
ofproto-dpif: Use set_field:OXM_OF_VLAN_VID on vlan packets in tests

It makes little sense to set the VID of a non-VLAN packet,
so push a VLAN tag before setting the VID.

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-actions: Stop processing of entire table on invalid TTL decrement

In the case of decrementing to an invalid NW or MPLS TTL processing of
the table should be terminated. However do to the nested processing of
the apply actions table only the processing of the apply actions
instruction was terminated and subsequent instructions for the table
would be processed.

For instance in the following case the packet would be processed
to table 2 even if dec_ttl was invalid.

ovs-ofctl add-flow br0 "icmp actions=dec_ttl,goto_table:2"

This patch resolves this problem by adding an exit_table
field to struct action_xlate_ctx and using it to determine if
table processing should continue or not.

This problem is specific to the osrg tree.

Signed-off-by: Simon Horman <horms@verge.net.au>
ofp-actions: Allow resubmit and goto_table after MPLS push

Background:

In order to supply some visibility to the inner-packet of
an MPLS packet the encap_dl_type field was added to struct flow
and is set in several places including when translating an
push MPLS action.

This turns out to be a poor design because the inner type can only
be known at translation time and a packet may not be available at this point:
in particular a packet is not available when translation occurs for
flow validation. Yet without a packet its not possible to decode fields
of the inner protocol. This approach has been abandoned upstream in favour
of recirculation but remains in the OSRG tree.

Problem:

One side-effect of this field being present is that if it
is a non-zero value then no rule will match, as no rules have
this field set. So resubmit and goto_table do not match any rules
that include any match at all: that is any rule that does not
use all-wildcards.

Fix:

In order to work around this the field is zeroed and restored
when looking up rules for resubmit and goto_table.

Signed-off-by: Simon Horman <horms@verge.net.au>