From: Simon Paillard <spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
To: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Simon Paillard <spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
Subject: [PATCH] rtnetlink.3: fix example code, use RTA_LENGTH macro
Date: Fri, 23 Mar 2012 01:31:26 +0100 [thread overview]
Message-ID: <1332462686-26100-1-git-send-email-spaillard@debian.org> (raw)
>From Kirill Brilliantov, http://bugs.debian.org/655088
---
man3/rtnetlink.3 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man3/rtnetlink.3 b/man3/rtnetlink.3
index 29d7765..ada93e2 100644
--- a/man3/rtnetlink.3
+++ b/man3/rtnetlink.3
@@ -109,7 +109,7 @@ Creating a rtnetlink message to set the MTU of a device:
rta = (struct rtattr *)(((char *) &req) +
NLMSG_ALIGN(req.nh.nlmsg_len));
rta\->rta_type = IFLA_MTU;
- rta\->rta_len = sizeof(unsigned int);
+ rta\->rta_len = RTA_LENGTH(sizeof(unsigned int));
req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
RTA_LENGTH(sizeof(mtu));
memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2012-03-23 0:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-23 0:31 Simon Paillard [this message]
[not found] ` <1332462686-26100-1-git-send-email-spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2012-03-24 0:13 ` [PATCH] rtnetlink.3: fix example code, use RTA_LENGTH macro Michael Kerrisk (man-pages)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1332462686-26100-1-git-send-email-spaillard@debian.org \
--to=spaillard-8fiuurrzop0dnm+yrofe0a@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox