Skip to content

Commit

Permalink
connector - documentation: simplify netlink message length assignment
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
minipli authored and davem330 committed Oct 2, 2013
1 parent ac73bf5 commit 05742fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/connector/ucon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 05742fa

Please sign in to comment.