From: "Linus Lüssing" <linus.luessing@c0d3.blue>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [PATCH v2 3/4] batman-adv: Introduce packet type independent TVLV handler API
Date: Mon, 19 Dec 2016 11:50:27 +0100 [thread overview]
Message-ID: <20161219105027.GL6323@otheros> (raw)
In-Reply-To: <31536424.nRq5nXL76i@sven-edge>
On Wed, Dec 14, 2016 at 09:12:00PM +0100, Sven Eckelmann wrote:
> On Mittwoch, 14. Dezember 2016 21:03:05 CET Sven Eckelmann wrote:
> > On Donnerstag, 6. Oktober 2016 08:41:40 CET Linus Lüssing wrote:
> > > + void *ctx = batadv_tvlv_ogm_pack_ctx(orig_node);
> > > + const struct ethhdr *ethhdr = eth_hdr(skb);
> > > + unsigned int tvlv_offset = sizeof(*ogm2);
> >
> > Haven't checked the complete code yet but isn't an increase of the
> > reference counter for orig_node missing here? Things like
> > batadv_gw_tvlv_ogm_handler would then have to take care of dropping
> > the reference.
>
> Ok, forget that. batadv_tvlv_containers_process2 (which is the only user of
> ctx) is directly calling the function and not delaying anything. I was under
> the impression that their might be an delay.
>
> But I am really not sure why you are using batadv_tvlv_ogm_pack_ctx anyway.
> You should be able to use "void *ctx" in batadv_tvlv_ogm_pack_ctx parameter
> and then give it an struct batadv_orig_node *. Or is is just for the WARN_ON?
Hm, no, had nothing to do with the WARN_ON. The idea was to have
the nasty (void *) casting at least at some well-defined place.
And didn't use "void *ctx" as a parameter of _pack_ctx() directly,
to have at least some compile-time verification regarding the
types.
I wanted to have something a little similar to the way icmp_hdr(), icmp6_hdr(),
ipv6_hdr() etc. do the casting, for instance, hm.
(or maybe I should add something like a "struct batadv_tvlv_ctx {
void *ctx };" then, to really get rid of the void pointers in the
functions calling the _pack()/_unpack() ones?)
next prev parent reply other threads:[~2016-12-19 10:50 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 6:41 [B.A.T.M.A.N.] [PATCH v2 0/4] Broadcast Avoidances, Neighborhood Hash Linus Lüssing
2016-10-06 6:41 ` [B.A.T.M.A.N.] [PATCH v2 1/4] batman-adv: Keep hard interface neighbor list sorted Linus Lüssing
2016-12-14 18:48 ` Sven Eckelmann
2016-12-14 19:23 ` Sven Eckelmann
2017-01-28 3:13 ` Linus Lüssing
2017-01-28 3:40 ` Linus Lüssing
2017-01-28 9:07 ` Sven Eckelmann
2016-10-06 6:41 ` [B.A.T.M.A.N.] [PATCH v2 2/4] batman-adv: Store and transmit own neighborhood hash Linus Lüssing
2016-12-14 20:28 ` Sven Eckelmann
2016-12-19 13:32 ` Linus Lüssing
2016-12-14 20:49 ` Sven Eckelmann
2016-12-14 20:57 ` Sven Eckelmann
2016-10-06 6:41 ` [B.A.T.M.A.N.] [PATCH v2 3/4] batman-adv: Introduce packet type independent TVLV handler API Linus Lüssing
2016-12-14 14:50 ` Sven Eckelmann
2016-12-19 10:29 ` Linus Lüssing
2017-01-22 12:40 ` Sven Eckelmann
2016-12-14 20:03 ` Sven Eckelmann
2016-12-14 20:12 ` Sven Eckelmann
2016-12-19 10:50 ` Linus Lüssing [this message]
2016-12-19 11:37 ` Sven Eckelmann
2016-12-19 11:43 ` Sven Eckelmann
2016-12-20 11:55 ` Linus Lüssing
2017-01-22 12:51 ` Sven Eckelmann
2016-10-06 6:41 ` [B.A.T.M.A.N.] [PATCH v2 4/4] batman-adv: Evaluate and use neighborhood hash TVLV Linus Lüssing
2016-12-14 14:49 ` [B.A.T.M.A.N.] [PATCH v2 0/4] Broadcast Avoidances, Neighborhood Hash Sven Eckelmann
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=20161219105027.GL6323@otheros \
--to=linus.luessing@c0d3.blue \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.