From: Marek Lindner <mareklindner@neomailbox.ch>
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] batman-adv: generalize batman-adv icmp packet handling
Date: Wed, 16 Oct 2013 13:59:18 +0800 [thread overview]
Message-ID: <1779622.xWDEdjCAYf@diderot> (raw)
In-Reply-To: <20131015192023.GN3873@neomailbox.net>
[-- Attachment #1: Type: text/plain, Size: 1645 bytes --]
On Tuesday 15 October 2013 21:20:23 Antonio Quartulli wrote:
> > Besides, if we make everything generic batadv_socket_packet->icmp_packet
> > should not be hard-coded to batadv_icmp_packet_rr but the largest
> > available
> > ICMP packet type ?
>
> or we dynamically allocate a buffer of size 'len'? In this way we don't need
> to change icmp_packet each time (hopefully not so many but still..) the
> "largest available ICMP packet type" changes.
Allocating a dynamic buffer does not solve the underlying issue. At some point
we would want to check the packet size - either through sizeof(socket_packet-
>icmp_packet) or a macro or whatever.
Take a look at batadv_max_header_len() for an idea how to address the matter.
> > Wouldn't it be better to dump unkown icmp types for us instead of copying
> > everything to user space ?
>
> dump == drop ? in that case I agree. Delivering unknown packets to batctl
> may also be dangerous.
Yes, that is what I was talking about.
> > Same is true for batadv_socket_write(). We should use the icmp header and
> > not assume icmp echo.
>
> do you mean using the ICMP header to understand what packet it is and then
> behave accordingly? Also in this case I agree with you :)
Yap.
> Moving to a packet type based "check" was also part of the original idea of
> this generalisation (if I remember correctly), but not really needed when
> looking at avoiding further compatibility breakage (this should be the
> reason why this "feature" is not part of this patch).
I agree - it is not strictly needed but would fit since the rest of the patch
works into the same direction.
Cheers,
Marek
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 490 bytes --]
next prev parent reply other threads:[~2013-10-16 5:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 16:08 [B.A.T.M.A.N.] [PATCH] batman-adv: generalize batman-adv icmp packet handling Simon Wunderlich
2013-10-15 8:04 ` Marek Lindner
2013-10-15 19:20 ` Antonio Quartulli
2013-10-16 5:59 ` Marek Lindner [this message]
2013-10-16 6:16 ` Antonio Quartulli
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=1779622.xWDEdjCAYf@diderot \
--to=mareklindner@neomailbox.ch \
--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.