X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=datapath%2Fdatapath.c;h=0714a99866ff39f73c1d3e68a13edc6f9d4b7bdf;hb=94358dcffbec33cbcfd425e925139fd7e9d6153f;hp=08562a349fac0c9aa2f9800695356a140a1b9125;hpb=c58cc9a460fd158e5250e59902e96ac677dc115f;p=sliver-openvswitch.git diff --git a/datapath/datapath.c b/datapath/datapath.c index 08562a349..0714a9986 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -1153,6 +1153,18 @@ static struct datapath *lookup_datapath(struct net *net, return dp ? dp : ERR_PTR(-ENODEV); } +static void ovs_dp_reset_user_features(struct sk_buff *skb, struct genl_info *info) +{ + struct datapath *dp; + + dp = lookup_datapath(sock_net(skb->sk), info->userhdr, info->attrs); + if (!dp) + return; + + WARN(dp->user_features, "Dropping previously announced user features\n"); + dp->user_features = 0; +} + static void ovs_dp_change(struct datapath *dp, struct nlattr **a) { if (a[OVS_DP_ATTR_USER_FEATURES]) @@ -1219,6 +1231,15 @@ static int ovs_dp_cmd_new(struct sk_buff *skb, struct genl_info *info) if (err == -EBUSY) err = -EEXIST; + if (err == -EEXIST) { + /* An outdated user space instance that does not understand + * the concept of user_features has attempted to create a new + * datapath and is likely to reuse it. Drop all user features. + */ + if (info->genlhdr->version < OVS_DP_VER_FEATURES) + ovs_dp_reset_user_features(skb, info); + } + goto err_destroy_ports_array; }