From f150da5ef8e62a1d2a4a0cb93652a210f5426c31 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 17 Jan 2013 15:24:59 +0900 Subject: [PATCH] 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 --- lib/dpif-netdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.43.0