From: Mathias Krause Date: Mon, 30 Sep 2013 20:03:09 +0000 (+0200) Subject: connector - documentation: simplify netlink message length assignment X-Git-Tag: firefly_0821_release~176^2~5117^2~83^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=05742faf2512b94907f49b21581ed4667b9bd702;p=firefly-linux-kernel-4.4.55.git connector - documentation: simplify netlink message length assignment Use the precalculated size instead of obfuscating the message length calculation by first subtracting the netlink header length from size and then use the NLMSG_LENGTH() macro to add it back again. Signed-off-by: Mathias Krause Signed-off-by: David S. Miller --- diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c index 4848db8c71ff..8a4da64e02a8 100644 --- a/Documentation/connector/ucon.c +++ b/Documentation/connector/ucon.c @@ -71,7 +71,7 @@ static int netlink_send(int s, struct cn_msg *msg) nlh->nlmsg_seq = seq++; nlh->nlmsg_pid = getpid(); nlh->nlmsg_type = NLMSG_DONE; - nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh)); + nlh->nlmsg_len = size; nlh->nlmsg_flags = 0; m = NLMSG_DATA(nlh);