From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
jesus.sanchez-palencia@intel.com, simon.fok@baesystems.com
Subject: Re: [PATCH iproute2 net-next v2 2/6] include: Add helper to retrieve a __s64 from a netlink msg
Date: Fri, 05 Oct 2018 10:08:09 -0700 [thread overview]
Message-ID: <87efd4tj7q.fsf@intel.com> (raw)
In-Reply-To: <20181005084107.GA16936@apalos>
Hi Ilias,
Ilias Apalodimas <ilias.apalodimas@linaro.org> writes:
> On Thu, Oct 04, 2018 at 04:17:07PM -0700, Vinicius Costa Gomes wrote:
>> This allows signed 64-bit integers to be retrieved from a netlink
>> message.
>> ---
>> include/libnetlink.h | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/include/libnetlink.h b/include/libnetlink.h
>> index 9d9249e6..88164975 100644
>> --- a/include/libnetlink.h
>> +++ b/include/libnetlink.h
>> @@ -185,6 +185,13 @@ static inline __u64 rta_getattr_u64(const struct rtattr *rta)
>> memcpy(&tmp, RTA_DATA(rta), sizeof(__u64));
>> return tmp;
>> }
>> +static inline __s64 rta_getattr_s64(const struct rtattr *rta)
>> +{
>> + __s64 tmp;
>> +
>> + memcpy(&tmp, RTA_DATA(rta), sizeof(__s64));
> Maybe change it to sizeof(tmp)?
Will fix. Thanks.
>> + return tmp;
>> +}
>> static inline const char *rta_getattr_str(const struct rtattr *rta)
>> {
>> return (const char *)RTA_DATA(rta);
>> --
>> 2.19.0
>>
Cheers,
next prev parent reply other threads:[~2018-10-06 0:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 23:17 [PATCH iproute2 net-next v2 0/6] Introduce the taprio scheduler Vinicius Costa Gomes
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 1/6] utils: Implement get_s64() Vinicius Costa Gomes
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 2/6] include: Add helper to retrieve a __s64 from a netlink msg Vinicius Costa Gomes
2018-10-05 8:41 ` Ilias Apalodimas
2018-10-05 17:08 ` Vinicius Costa Gomes [this message]
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 3/6] libnetlink: Add helper for getting a __s32 from netlink msgs Vinicius Costa Gomes
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 4/6] include: add definitions for taprio [DO NOT COMMIT] Vinicius Costa Gomes
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 5/6] tc: Add support for configuring the taprio scheduler Vinicius Costa Gomes
2018-10-04 23:17 ` [PATCH iproute2 net-next v2 6/6] taprio: Add manpage for tc-taprio(8) Vinicius Costa Gomes
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=87efd4tj7q.fsf@intel.com \
--to=vinicius.gomes@intel.com \
--cc=ilias.apalodimas@linaro.org \
--cc=jesus.sanchez-palencia@intel.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=simon.fok@baesystems.com \
--cc=xiyou.wangcong@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).