* the method to get nlmsg_len in audit_send() is error
@ 2008-07-28 9:02 Yu Zhiguo
2008-07-28 16:45 ` Steve Grubb
0 siblings, 1 reply; 2+ messages in thread
From: Yu Zhiguo @ 2008-07-28 9:02 UTC (permalink / raw)
To: Steve Grubb; +Cc: audit-list
Hello Steve,
I think micro NLMSG_ALIGN is needless for nlmsg_len, NLMSG_SPACE is sufficient.
because NLMSG_SPACE includes the rounded netlink header size.
Now no errors occurred because struct req has been set to all 0.
Signed-off-by: Yu Zhiguo<yuzg@cn.fujitsu.com>
---
lib/netlink.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/netlink.c b/lib/netlink.c
index 2f78a96..2e2e6be 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -220,7 +220,7 @@ int audit_send(int fd, int type, const void *data, unsigned
int size)
sequence = 1;
memset(&req, 0, sizeof(req));
- req.nlh.nlmsg_len = NLMSG_ALIGN(req.nlh.nlmsg_len) + NLMSG_SPACE(size);
+ req.nlh.nlmsg_len = NLMSG_SPACE(size);
req.nlh.nlmsg_type = type;
req.nlh.nlmsg_flags = NLM_F_REQUEST|NLM_F_ACK;
req.nlh.nlmsg_seq = sequence;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: the method to get nlmsg_len in audit_send() is error
2008-07-28 9:02 the method to get nlmsg_len in audit_send() is error Yu Zhiguo
@ 2008-07-28 16:45 ` Steve Grubb
0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2008-07-28 16:45 UTC (permalink / raw)
To: Yu Zhiguo; +Cc: audit-list
On Monday 28 July 2008 05:02:53 Yu Zhiguo wrote:
> I think micro NLMSG_ALIGN is needless for nlmsg_len, NLMSG_SPACE is
> sufficient. because NLMSG_SPACE includes the rounded netlink header size.
I guess you are right. I checked the macros just be sure since this is some of
the oldest code in the audit project and hasn't changed in a very long time.
Applied. Thanks for the patch.
-Steve
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-28 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-28 9:02 the method to get nlmsg_len in audit_send() is error Yu Zhiguo
2008-07-28 16:45 ` Steve Grubb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox