diff options
author | Simon Horman <horms@verge.net.au> | 2013-05-22 16:08:06 +0900 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2013-05-23 10:33:16 -0700 |
commit | 12b3586d5743fec767367a9cbc9e04bebda170c4 (patch) | |
tree | 3275b0de91349bea4e6903821d3a9f292677557f /lib/dpif-netdev.c | |
parent | 40dbc7f80a52b3ddd5b306eb75ac5f7e73a765ae (diff) |
dpif-netdev: Move decoding of data out of dp_netdev_output_userspace()
This is in preparation for making dp_netdev_action_userspace()
more generic and passing dp_netdev_output_userspace() as a callback.
In this case it makes sense to decode userdata in generic code.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/dpif-netdev.c')
-rw-r--r-- | lib/dpif-netdev.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 86207e99..a4ac23f1 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1199,11 +1199,8 @@ dp_netdev_sample(struct dp_netdev *dp, static void dp_netdev_action_userspace(struct dp_netdev *dp, struct ofpbuf *packet, const struct flow *key, - const struct nlattr *a) + const struct nlattr *userdata) { - const struct nlattr *userdata; - - userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA); dp_netdev_output_userspace(dp, packet, DPIF_UC_ACTION, key, userdata); } @@ -1287,9 +1284,13 @@ dp_netdev_execute_actions(struct dp_netdev *dp, dp_netdev_output_port(dp, packet, nl_attr_get_u32(a)); break; - case OVS_ACTION_ATTR_USERSPACE: - dp_netdev_action_userspace(dp, packet, key, a); + case OVS_ACTION_ATTR_USERSPACE: { + const struct nlattr *userdata; + + userdata = nl_attr_find_nested(a, OVS_USERSPACE_ATTR_USERDATA); + dp_netdev_action_userspace(dp, packet, key, userdata); break; + } case OVS_ACTION_ATTR_PUSH_VLAN: { const struct ovs_action_push_vlan *vlan = nl_attr_get(a); |