From: Simon Horman Date: Thu, 17 Jan 2013 06:24:59 +0000 (+0900) Subject: dpif-netdev: Limit scope of vlan in dp_netdev_execute_actions X-Git-Tag: sliver-openvswitch-1.9.90-3~8^2~18 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=f150da5ef8e62a1d2a4a0cb93652a210f5426c31 dpif-netdev: Limit scope of vlan in dp_netdev_execute_actions This is to make the code consistent with the proposed MPLS changes and avoid cluttering the top of the NL_ATTR_FOR_EACH_UNSAFE loop. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 3d9cd85fb..bec32c38d 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -1249,7 +1249,6 @@ dp_netdev_execute_actions(struct dp_netdev *dp, unsigned int left; NL_ATTR_FOR_EACH_UNSAFE (a, left, actions, actions_len) { - const struct ovs_action_push_vlan *vlan; int type = nl_attr_type(a); switch ((enum ovs_action_attr) type) { @@ -1261,10 +1260,11 @@ dp_netdev_execute_actions(struct dp_netdev *dp, dp_netdev_action_userspace(dp, packet, key, a); break; - case OVS_ACTION_ATTR_PUSH_VLAN: - vlan = nl_attr_get(a); + case OVS_ACTION_ATTR_PUSH_VLAN: { + const struct ovs_action_push_vlan *vlan = nl_attr_get(a); eth_push_vlan(packet, vlan->vlan_tci); break; + } case OVS_ACTION_ATTR_POP_VLAN: eth_pop_vlan(packet);