From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, donald.hunter@gmail.com, jiri@resnulli.us,
sdf@google.com
Subject: Re: [PATCH net-next v2 02/15] tools: ynl: create local attribute helpers
Date: Tue, 27 Feb 2024 16:10:44 +0100 [thread overview]
Message-ID: <c60fdfff-9792-44ce-a811-b2ccf201d3ed@6wind.com> (raw)
In-Reply-To: <20240227065614.57946760@kernel.org>
Le 27/02/2024 à 15:56, Jakub Kicinski a écrit :
> On Tue, 27 Feb 2024 12:05:31 +0100 Nicolas Dichtel wrote:
>>> +static inline __s16 ynl_attr_get_s16(const struct nlattr *attr)
>>> +{
>>> + __s16 tmp;
>>> +
>>> + memcpy(&tmp, (unsigned char *)(attr + 1), sizeof(tmp));
>> The same would work here, am I wrong?
>> return *(__s16 *)ynl_attr_data(attr);
>>
>> Same for all kind of int.
>
> What about unaligned access?
Attributes are aligned, at least u16 and u32
For u64, it's not true anymore (:
next prev parent reply other threads:[~2024-02-27 15:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 21:20 [PATCH net-next v2 00/15] tools: ynl: stop using libmnl Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 01/15] tools: ynl: give up on libmnl for auto-ints Jakub Kicinski
2024-02-27 10:38 ` Nicolas Dichtel
2024-02-26 21:20 ` [PATCH net-next v2 02/15] tools: ynl: create local attribute helpers Jakub Kicinski
2024-02-27 11:05 ` Nicolas Dichtel
2024-02-27 14:56 ` Jakub Kicinski
2024-02-27 15:10 ` Nicolas Dichtel [this message]
2024-02-26 21:20 ` [PATCH net-next v2 03/15] tools: ynl: create local for_each helpers Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 04/15] tools: ynl: create local nlmsg access helpers Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 05/15] tools: ynl: create local ARRAY_SIZE() helper Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 06/15] tools: ynl: make yarg the first member of struct ynl_dump_state Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 07/15] tools: ynl-gen: remove unused parse code Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 08/15] tools: ynl: wrap recv() + mnl_cb_run2() into a single helper Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 09/15] tools: ynl: use ynl_sock_read_msgs() for ACK handling Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 10/15] tools: ynl: stop using mnl_cb_run2() Jakub Kicinski
2024-02-27 11:06 ` Nicolas Dichtel
2024-02-26 21:20 ` [PATCH net-next v2 11/15] tools: ynl: switch away from mnl_cb_t Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 12/15] tools: ynl: switch away from MNL_CB_* Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 13/15] tools: ynl: stop using mnl socket helpers Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 14/15] tools: ynl: remove the libmnl dependency Jakub Kicinski
2024-02-26 21:20 ` [PATCH net-next v2 15/15] tools: ynl: use MSG_DONTWAIT for getting notifications Jakub Kicinski
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=c60fdfff-9792-44ce-a811-b2ccf201d3ed@6wind.com \
--to=nicolas.dichtel@6wind.com \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@google.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).