drop_monitor: consider inserted data in genlmsg_end

commit 3b48ab2248e61408910e792fe84d6ec466084c1a upstream.

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>
Signed-off-by: Willy Tarreau <w@1wt.eu>
This commit is contained in:
Reiter Wolfgang 2017-01-03 01:39:10 +01:00 committed by syphyr
parent 9a51c5b524
commit 370ed9ad64
1 changed files with 7 additions and 1 deletions

View File

@ -107,7 +107,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:
@ -117,6 +116,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;
}