diff options
author | Jesse Gross <jesse@nicira.com> | 2011-08-01 00:35:20 -0700 |
---|---|---|
committer | Jesse Gross <jesse@nicira.com> | 2011-09-14 12:56:57 -0700 |
commit | e087eb215b346ac42fc9d7b96faeb272aa5d68e7 (patch) | |
tree | 563e181b9bf3bd464dcced8cb5b63040268c6de6 | |
parent | c5e3adc986cd6e44d69170ad9a84c0970653665f (diff) | |
download | openvswitch-e087eb215b346ac42fc9d7b96faeb272aa5d68e7.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>
-rw-r--r-- | datapath/datapath.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c index 2f30bdcf8..ccdcb754d 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -713,6 +713,11 @@ static int odp_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(); |