aboutsummaryrefslogtreecommitdiff
path: root/datapath
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2009-09-04 22:23:29 -0700
committerJustin Pettit <jpettit@nicira.com>2009-09-04 22:23:29 -0700
commit8398cf7efc3979cd6c8152915a584c13873ee322 (patch)
treeaf44c62d6be2610c3d4b02e5e29536efaa546df7 /datapath
parentc3a519b5c987a6213b65ff4c2fbc817ecd287fbe (diff)
parenta393b897f27405592dc56f7084796c8bf1815519 (diff)
Merge commit 'origin/citrix'
Diffstat (limited to 'datapath')
-rw-r--r--datapath/datapath.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 6f96ee40..427391ad 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -1107,6 +1107,7 @@ static int do_execute(struct datapath *dp, const struct odp_execute *executep)
struct odp_flow_key key;
struct sk_buff *skb;
struct sw_flow_actions *actions;
+ struct ethhdr *eth;
int err;
err = -EFAULT;
@@ -1146,6 +1147,17 @@ static int do_execute(struct datapath *dp, const struct odp_execute *executep)
execute.length))
goto error_free_skb;
+ skb_reset_mac_header(skb);
+ eth = eth_hdr(skb);
+
+ /* Normally, setting the skb 'protocol' field would be handled by a
+ * call to eth_type_trans(), but it assumes there's a sending
+ * device, which we may not have. */
+ if (ntohs(eth->h_proto) >= 1536)
+ skb->protocol = eth->h_proto;
+ else
+ skb->protocol = htons(ETH_P_802_2);
+
flow_extract(skb, execute.in_port, &key);
err = execute_actions(dp, skb, &key, actions->actions,
actions->n_actions, GFP_KERNEL);