summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiter Wolfgang <wr0112358@gmail.com>2017-01-03 03:39:10 +0300
committerDavid S. Miller <davem@davemloft.net>2017-01-03 19:09:44 +0300
commit3b48ab2248e61408910e792fe84d6ec466084c1a (patch)
treedeabffe774faf6423b9961ed234d3104e9741a06
parent096de2f83ebc8e0404c5b7e847a4abd27b9739da (diff)
downloadlinux-3b48ab2248e61408910e792fe84d6ec466084c1a.tar.xz
drop_monitor: consider inserted data in genlmsg_end
Final nlmsg_len field update must reflect inserted net_dm_drop_point data. This patch depends on previous patch: "drop_monitor: add missing call to genlmsg_end" Signed-off-by: Reiter Wolfgang <wr0112358@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/drop_monitor.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index f465bad2ef2c..fb55327dcfea 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -102,7 +102,6 @@ static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data)
}
msg = nla_data(nla);
memset(msg, 0, al);
- genlmsg_end(skb, msg_header);
goto out;
err:
@@ -112,6 +111,13 @@ out:
swap(data->skb, skb);
spin_unlock_irqrestore(&data->lock, flags);
+ if (skb) {
+ struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
+ struct genlmsghdr *gnlh = (struct genlmsghdr *)nlmsg_data(nlh);
+
+ genlmsg_end(skb, genlmsg_data(gnlh));
+ }
+
return skb;
}