Commit 7827edca authored by Daniel Alvarez's avatar Daniel Alvarez Committed by Ben Pfaff

Add dl_type to flow metadata for correct interpretation of conntrack metadata

When a packet is sent to the controller, dl_type is not stored in the
'ofputil_packet_in_private'. When the packet is resumed, the flow's
dl_type is 0 and this leads to invalid value in ct_orig_tuple in the

This patch adds the dl_type to the metadata so that conntrack
information can be interpreted correctly when packets are resumed.

This is a change from the ordinary practice, since flow_get_metadata() is
only supposed to deal with metadata and dl_type is not metadata.  It is
necessary when ct_state is involved, though, because ct_state only applies
in the case of particular Ethertypes (IPv4 and IPv6 currently), so we need
to add it as a kind of prerequisite.  (This isn't ideal; maybe we didn't
think through the ct_state mechanism carefully enough.)
Reported-by: default avatarDaniel Alvarez Sanchez <>
Reported-at: default avatarDaniel Alvarez <>
Signed-off-by: default avatarNuman Siddique <>
Signed-off-by: default avatarBen Pfaff <>
parent 7ebfcd3d
......@@ -1073,6 +1073,9 @@ flow_get_metadata(const struct flow *flow, struct match *flow_metadata)
if (flow->ct_state != 0) {
match_set_ct_state(flow_metadata, flow->ct_state);
/* Match dl_type since it is required for the later interpretation of
* the conntrack metadata. */
match_set_dl_type(flow_metadata, flow->dl_type);
if (is_ct_valid(flow, NULL, NULL) && flow->ct_nw_proto != 0) {
if (flow->dl_type == htons(ETH_TYPE_IP)) {
match_set_ct_nw_src(flow_metadata, flow->ct_nw_src);
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment