-exit:
- return skb->len;
-}
-
-int flow_copy_from_user(struct sw_flow_key *swkey, const struct nlattr __user *ukey, u32 ukey_len)
-{
- char key[FLOW_BUFSIZE] __aligned(NLA_ALIGNTO);
-
- if (ukey_len > FLOW_BUFSIZE || ukey_len % NLA_ALIGNTO)
- return -EINVAL;
-
- if (copy_from_user(key, ukey, ukey_len))
- return -EFAULT;
-
- return flow_from_nlattrs(swkey, (const struct nlattr *)key, ukey_len);
-}
-
-int flow_copy_to_user(struct nlattr __user *ukey, const struct sw_flow_key *swkey, u32 ukey_len)
-{
- struct sk_buff *skb;
- int retval;
-
- skb = alloc_skb(FLOW_BUFSIZE, GFP_KERNEL);
- if (!skb)
- return -ENOMEM;
-
- retval = flow_to_nlattrs(swkey, skb);
- if (copy_to_user(ukey, skb->data, min(skb->len, ukey_len)))
- retval = -EFAULT;
- kfree_skb(skb);