summaryrefslogtreecommitdiff
path: root/datapath/datapath.c
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2011-08-01 00:35:20 -0700
committerJesse Gross <jesse@nicira.com>2011-09-14 12:54:07 -0700
commitcc4015df5f24df80ad8ebf0ed965782b44964b4e (patch)
treee37c05f50693a9dde697acd3eb6483b75fde66b1 /datapath/datapath.c
parent0993b66bf85d8816b1937675364c8ff268ccecd8 (diff)
downloadopenvswitch-cc4015df5f24df80ad8ebf0ed965782b44964b4e.tar.gz
datapath: Set vport in skb when executed from userspace.
Currently, the OVS_CB(skb)->vport member is never initialized for packets coming from userspace. This means that they can never be sampled by sFlow and generally violates our principle that userspace packets should be made to look the same as others. Signed-off-by: Jesse Gross <jesse@nicira.com> Acked-by: Pravin Shelar <pshelar@nicira.com>
Diffstat (limited to 'datapath/datapath.c')
-rw-r--r--datapath/datapath.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index 79df5f898..232b26504 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -687,6 +687,11 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
err = -ENODEV;
if (!dp)
goto err_unlock;
+
+ if (flow->key.eth.in_port < DP_MAX_PORTS)
+ OVS_CB(packet)->vport = get_vport_protected(dp,
+ flow->key.eth.in_port);
+
err = execute_actions(dp, packet);
rcu_read_unlock();