diff options
author | Reiter Wolfgang <wr0112358@gmail.com> | 2017-01-02 19:39:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-03 11:09:44 -0500 |
commit | 3b48ab2248e61408910e792fe84d6ec466084c1a (patch) | |
tree | deabffe774faf6423b9961ed234d3104e9741a06 | |
parent | 096de2f83ebc8e0404c5b7e847a4abd27b9739da (diff) |
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.c | 8 |
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) | |||
102 | } | 102 | } |
103 | msg = nla_data(nla); | 103 | msg = nla_data(nla); |
104 | memset(msg, 0, al); | 104 | memset(msg, 0, al); |
105 | genlmsg_end(skb, msg_header); | ||
106 | goto out; | 105 | goto out; |
107 | 106 | ||
108 | err: | 107 | err: |
@@ -112,6 +111,13 @@ out: | |||
112 | swap(data->skb, skb); | 111 | swap(data->skb, skb); |
113 | spin_unlock_irqrestore(&data->lock, flags); | 112 | spin_unlock_irqrestore(&data->lock, flags); |
114 | 113 | ||
114 | if (skb) { | ||
115 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data; | ||
116 | struct genlmsghdr *gnlh = (struct genlmsghdr *)nlmsg_data(nlh); | ||
117 | |||
118 | genlmsg_end(skb, genlmsg_data(gnlh)); | ||
119 | } | ||
120 | |||
115 | return skb; | 121 | return skb; |
116 | } | 122 | } |
117 | 123 | ||