Skip to contentSkip to conversation

rtnetlink.3: tfix

PATCH In review HuKeping 2 participants 2 messages Sep 5, 2016 1 message not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore

HuKeping

author
#0 lore raw

PATCH 1/1 rtnetlink.3: tfix

It seems that the structure in this example doesn't have a field named n.

---
 man3/rtnetlink.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/rtnetlink.3 +1 -1
index 143be57..430206d 100644
@@ -113,7 +113,7 @@ Creating a rtnetlink message to set the MTU of a device:
                              NLMSG_ALIGN(req.nh.nlmsg_len));
     rta\->rta_type = IFLA_MTU;
     rta\->rta_len = RTA_LENGTH(sizeof(unsigned int));
-    req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
+    req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
                                   RTA_LENGTH(sizeof(mtu));
     memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));
     send(rtnetlink_sk, &req, req.nh.nlmsg_len, 0);
Signature · 6 lines
2.8.0.GIT

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

Hello Hu Keping,

Quoted 2 lines · HuKeping

It seems that the structure in this example doesn't have a field named n.

Thanks. Patch applied.

Cheers,

Michael

Quoted 19 lines
---
 man3/rtnetlink.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man3/rtnetlink.3 +1 -1
index 143be57..430206d 100644
@@ -113,7 +113,7 @@ Creating a rtnetlink message to set the MTU of a device:
                              NLMSG_ALIGN(req.nh.nlmsg_len));
     rta\->rta_type = IFLA_MTU;
     rta\->rta_len = RTA_LENGTH(sizeof(unsigned int));
-    req.n.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
+    req.nh.nlmsg_len = NLMSG_ALIGN(req.nh.nlmsg_len) +
                                   RTA_LENGTH(sizeof(mtu));
     memcpy(RTA_DATA(rta), &mtu, sizeof(mtu));
     send(rtnetlink_sk, &req, req.nh.nlmsg_len, 0);
Signature · 7 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html