* [PATCH] rtnetlink.3: fix example code, use RTA_LENGTH macro
@ 2012-03-23 0:31 Simon Paillard
[not found] ` <1332462686-26100-1-git-send-email-spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Simon Paillard @ 2012-03-23 0:31 UTC (permalink / raw)
To: linux-man-u79uwXL29TY76Z2rM5mHXA; +Cc: Simon Paillard
>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
^ permalink raw reply related [flat|nested] 2+ messages in thread[parent not found: <1332462686-26100-1-git-send-email-spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] rtnetlink.3: fix example code, use RTA_LENGTH macro [not found] ` <1332462686-26100-1-git-send-email-spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> @ 2012-03-24 0:13 ` Michael Kerrisk (man-pages) 0 siblings, 0 replies; 2+ messages in thread From: Michael Kerrisk (man-pages) @ 2012-03-24 0:13 UTC (permalink / raw) To: Simon Paillard Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Kirill Brilliantov, Sergei Zhirikov Thanks for forwarding this Simon. Applied for man-pages-3.38. Cheers, Michael On Fri, Mar 23, 2012 at 1:31 PM, Simon Paillard <spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org> wrote: > 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 -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- 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 ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-24 0:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-23 0:31 [PATCH] rtnetlink.3: fix example code, use RTA_LENGTH macro Simon Paillard
[not found] ` <1332462686-26100-1-git-send-email-spaillard-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org>
2012-03-24 0:13 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox