[ovs-dev] [netlink v4 50/52] datapath: Convert ODP_VPORT_* to use AF_NETLINK socket layer.

Jesse Gross jesse at nicira.com
Wed Jan 26 03:14:25 UTC 2011


On Tue, Jan 11, 2011 at 9:50 PM, Ben Pfaff <blp at nicira.com> wrote:
> diff --git a/datapath/datapath.c b/datapath/datapath.c
> index 5d4e1f2..c833a3d 100644
> --- a/datapath/datapath.c
> +++ b/datapath/datapath.c
> -static int get_vport(struct odp_vport __user *uodp_vport)
> +static int odppc_get(struct sk_buff *skb, struct genl_info *info)
>  {
> -       struct nlattr *a[ODPPT_MAX + 1];
> -       struct odp_vport *odp_vport;
> +       struct nlattr **a = info->attrs;
> +       struct odp_vport *odp_vport = info->userhdr;
> +       struct sk_buff *reply;
>        struct vport *vport;
> -       struct sk_buff *skb;
>        int err;
>
> -       skb = copy_vport_from_user(uodp_vport, a);
> -       err = PTR_ERR(skb);
> -       if (IS_ERR(skb))
> -               goto exit;
> -       odp_vport = (struct odp_vport *)skb->data;
> -
>        mutex_lock(&dp_mutex);
>        vport = lookup_vport(odp_vport, a);

I think we need to call odp_vport_cmd_validate() first.

I also see two instances of -EINVAL being returned if the port number
exceeds DP_MAX_PORTS instead of -EFBIG.

Otherwise, there are the similar issues from the previous patches that
I believe you are already working on:
* Multicast notifications on port change
* Unused multicast group field in dp_genl_families list
* Combining fixed headers for different families.




More information about the dev mailing list