+/* Given 'flow', a flow representing a packet received on 'ofproto', checks
+ * whether 'flow->in_port' represents a Linux VLAN device. If so, changes
+ * 'flow->in_port' to the "real" device backing the VLAN device, sets
+ * 'flow->vlan_tci' to the VLAN VID, and returns true. Otherwise (which is
+ * always the case unless VLAN splinters are enabled), returns false without
+ * making any changes. */
+static bool
+vsp_adjust_flow(const struct ofproto_dpif *ofproto, struct flow *flow)
+{
+ uint16_t realdev;
+ int vid;
+
+ realdev = vsp_vlandev_to_realdev(ofproto, flow->in_port, &vid);
+ if (!realdev) {
+ return false;
+ }
+
+ /* Cause the flow to be processed as if it came in on the real device with
+ * the VLAN device's VLAN ID. */
+ flow->in_port = realdev;
+ flow->vlan_tci = htons((vid & VLAN_VID_MASK) | VLAN_CFI);
+ return true;
+}
+