From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: add DAT cache netlink support
Date: Sun, 04 Mar 2018 18:34:27 +0100 [thread overview]
Message-ID: <2479551.zDrGEAAfck@sven-edge> (raw)
In-Reply-To: <3744465.nJcBpx8pQg@sven-edge>
[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]
On Sonntag, 4. März 2018 17:41:26 CET Sven Eckelmann wrote:
> On Dienstag, 27. Februar 2018 09:10:15 CET Linus Lüssing wrote:
> > + if (nla_put_u32(msg, BATADV_ATTR_DC_ADDRESS, ip) ||
> > + nla_put(msg, BATADV_ATTR_DC_HWADDRESS, ETH_ALEN,
> > + dat_entry->mac_addr) ||
> > + nla_put_u16(msg, BATADV_ATTR_DC_VID, dat_entry->vid) ||
> > + nla_put_u32(msg, BATADV_ATTR_LAST_SEEN_MSECS, msecs)) {
> > + genlmsg_cancel(msg, hdr);
> > + return -EMSGSIZE;
>
> Just found that there is a function to send IPv4 addresses
> (BATADV_ATTR_DC_ADDRESS) to userspace: nla_put_in_addr. It requires that you
> provide the IPv4 address in __be32 format and not in host format. It is maybe
> a good idea to use it and keep it more consistent with the rest of the kernel.
Btw. this function was introduced with linux-4.1 [1] and older kernels will
need compat code for it.
Kind regards,
Sven
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=930345ea630405aa6e6f42efcb149c3f360a6b67
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-03-04 17:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 8:10 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: add DAT cache netlink support Linus Lüssing
2018-02-27 8:10 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: add multicast flags " Linus Lüssing
2018-03-04 12:36 ` Sven Eckelmann
2018-03-04 13:36 ` Sven Eckelmann
2018-03-04 12:36 ` [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: add DAT cache " Sven Eckelmann
2018-03-04 16:41 ` Sven Eckelmann
2018-03-04 17:34 ` Sven Eckelmann [this message]
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=2479551.zDrGEAAfck@sven-edge \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/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