datapath: Use nla_len() in queue_userspace_packet().
authorJesse Gross <jesse@nicira.com>
Tue, 19 Feb 2013 19:01:33 +0000 (11:01 -0800)
committerJesse Gross <jesse@nicira.com>
Tue, 19 Feb 2013 19:01:33 +0000 (11:01 -0800)
Commit e995e3df57ea4e27678bc0bea5eb30872994155b (Allow
OVS_USERSPACE_ATTR_USERDATA to be variable length.) introduced an
open coded version of nla_len() in queue_userspace_packet().  This
replaces it with the equivalent function call.

Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c

index 0920a30..fc5d2de 100644 (file)
@@ -393,7 +393,7 @@ static int queue_userspace_packet(struct net *net, int dp_ifindex,
 
        if (upcall_info->userdata)
                __nla_put(user_skb, OVS_PACKET_ATTR_USERDATA,
-                         upcall_info->userdata->nla_len - NLA_HDRLEN,
+                         nla_len(upcall_info->userdata),
                          nla_data(upcall_info->userdata));
 
        nla = __nla_reserve(user_skb, OVS_PACKET_ATTR_PACKET, skb->len);