rename superclass member to up in netdev-tunnel
[sliver-openvswitch.git] / datapath / datapath.c
index a8bb5b8..42af315 100644 (file)
@@ -60,6 +60,7 @@
 #include "vlan.h"
 #include "tunnel.h"
 #include "vport-internal_dev.h"
+#include "vport-netdev.h"
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18) || \
     LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)
@@ -159,7 +160,7 @@ static int get_dpifindex(struct datapath *dp)
 
        local = ovs_vport_rcu(dp, OVSP_LOCAL);
        if (local)
-               ifindex = local->ops->get_ifindex(local);
+               ifindex = netdev_vport_priv(local)->dev->ifindex;
        else
                ifindex = 0;
 
@@ -2104,10 +2105,11 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
        if (IS_ERR(vport))
                goto exit_unlock;
 
-       err = 0;
        if (a[OVS_VPORT_ATTR_TYPE] &&
-           nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type)
+           nla_get_u32(a[OVS_VPORT_ATTR_TYPE]) != vport->ops->type) {
                err = -EINVAL;
+               goto exit_unlock;
+       }
 
        reply = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
        if (!reply) {
@@ -2115,10 +2117,11 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
                goto exit_unlock;
        }
 
-       if (!err && a[OVS_VPORT_ATTR_OPTIONS])
+       if (a[OVS_VPORT_ATTR_OPTIONS]) {
                err = ovs_vport_set_options(vport, a[OVS_VPORT_ATTR_OPTIONS]);
-       if (err)
-               goto exit_free;
+               if (err)
+                       goto exit_free;
+       }
 
        if (a[OVS_VPORT_ATTR_STATS])
                ovs_vport_set_stats(vport, nla_data(a[OVS_VPORT_ATTR_STATS]));
@@ -2130,9 +2133,8 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
                                      info->snd_seq, 0, OVS_VPORT_CMD_NEW);
        BUG_ON(err < 0);
 
-       ovs_notify(reply, info, &ovs_dp_vport_multicast_group);
-
        ovs_unlock();
+       ovs_notify(reply, info, &ovs_dp_vport_multicast_group);
        return 0;
 
 exit_free: