summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-12-15 18:31:21 (GMT)
committerThomas Haller <thaller@redhat.com>2016-12-15 18:41:06 (GMT)
commit02cccc69bcca9148fda5c488784a6bd3c23bf1b4 (patch)
tree782a790c1cdaca48530c2c71343ff7f91b15a9c1 /lib
parentc033ee8cb4de4fa5a0fd1bb6995b7a992858ccf9 (diff)
downloadlibnl-02cccc69bcca9148fda5c488784a6bd3c23bf1b4.zip
libnl-02cccc69bcca9148fda5c488784a6bd3c23bf1b4.tar.gz
libnl-02cccc69bcca9148fda5c488784a6bd3c23bf1b4.tar.bz2
utils/trivial: rename internal _nl_offset_plus_sizeof() macro to _nl_offsetofend()
Kernel calls a very similar macro "offsetofend". So use that name as it migth be more familiar to the reader. Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/route/link.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/route/link.c b/lib/route/link.c
index b26f871..4840c23 100644
--- a/lib/route/link.c
+++ b/lib/route/link.c
@@ -346,8 +346,8 @@ struct nla_policy rtln_link_policy[IFLA_MAX+1] = {
[IFLA_LINKINFO] = { .type = NLA_NESTED },
[IFLA_QDISC] = { .type = NLA_STRING,
.maxlen = IFQDISCSIZ },
- [IFLA_STATS] = { .minlen = _nl_offset_plus_sizeof (struct rtnl_link_stats, tx_compressed) },
- [IFLA_STATS64] = { .minlen = _nl_offset_plus_sizeof (struct rtnl_link_stats64, tx_compressed) },
+ [IFLA_STATS] = { .minlen = _nl_offsetofend (struct rtnl_link_stats, tx_compressed) },
+ [IFLA_STATS64] = { .minlen = _nl_offsetofend (struct rtnl_link_stats64, tx_compressed) },
[IFLA_MAP] = { .minlen = sizeof(struct rtnl_link_ifmap) },
[IFLA_IFALIAS] = { .type = NLA_STRING, .maxlen = IFALIASZ },
[IFLA_NUM_VF] = { .type = NLA_U32 },
@@ -413,9 +413,9 @@ int rtnl_link_info_parse(struct rtnl_link *link, struct nlattr **tb)
link->l_stats[RTNL_LINK_TX_COMPRESSED] = st->tx_compressed;
/* beware: @st might not be the full struct, only fields up to
- * tx_compressed are present. See _nl_offset_plus_sizeof() above. */
+ * tx_compressed are present. See _nl_offsetofend() above. */
- if (nla_len(tb[IFLA_STATS]) >= _nl_offset_plus_sizeof (struct rtnl_link_stats, rx_nohandler))
+ if (nla_len(tb[IFLA_STATS]) >= _nl_offsetofend (struct rtnl_link_stats, rx_nohandler))
link->l_stats[RTNL_LINK_RX_NOHANDLER] = st->rx_nohandler;
else
link->l_stats[RTNL_LINK_RX_NOHANDLER] = 0;
@@ -463,7 +463,7 @@ int rtnl_link_info_parse(struct rtnl_link *link, struct nlattr **tb)
link->l_stats[RTNL_LINK_TX_COMPRESSED] = st.tx_compressed;
/* beware: @st might not be the full struct, only fields up to
- * tx_compressed are present. See _nl_offset_plus_sizeof() above. */
+ * tx_compressed are present. See _nl_offsetofend() above. */
link->l_stats[RTNL_LINK_RX_NOHANDLER] = st.rx_nohandler;