diff options
| author | Jesse Gross <jesse@nicira.com> | 2011-09-19 16:23:25 -0700 |
|---|---|---|
| committer | Jesse Gross <jesse@nicira.com> | 2011-09-19 16:48:51 -0700 |
| commit | 5721c788f25dda3be1b281331db262f6806ab35e (patch) | |
| tree | 907f599c8477263a947e962700e40d6b0b17db6c /datapath | |
| parent | cca208bb634b0825f8d56fde4ec10a240a45e9c1 (diff) | |
| download | openvswitch-5721c788f25dda3be1b281331db262f6806ab35e.tar.gz | |
datapath: Correctly set error code in queue_userspace_packets().
In a few places in queue_userspace_packets() when we encounter an
error, we don't actually set the 'err' variable. Although we
free the packets we don't correctly account for these packets as
being lost.
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'datapath')
| -rw-r--r-- | datapath/datapath.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c index 98c2bafd3..1fba23bf7 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -449,8 +449,10 @@ static int queue_userspace_packets(struct datapath *dp, struct sk_buff *skb, if (unlikely(err)) goto err_kfree_skbs; - if (nla_attr_size(skb->len) > USHRT_MAX) + if (nla_attr_size(skb->len) > USHRT_MAX) { + err = -EFBIG; goto err_kfree_skbs; + } len = sizeof(struct ovs_header); len += nla_total_size(skb->len); @@ -465,6 +467,7 @@ static int queue_userspace_packets(struct datapath *dp, struct sk_buff *skb, user_skb = genlmsg_new(len, GFP_ATOMIC); if (!user_skb) { netlink_set_err(INIT_NET_GENL_SOCK, 0, group, -ENOBUFS); + err = -ENOMEM; goto err_kfree_skbs; } |
