From: Antonio Quartulli <antonio@meshcoding.com>
To: Sven Eckelmann <sven@narfation.org>,
Marek Lindner <mareklindner@neomailbox.ch>
Cc: 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 4/4] batman-adv: Fix gw_bandwidth calculation on 32 bit systems
Date: Mon, 29 Jun 2015 11:47:00 +0200 [thread overview]
Message-ID: <55911414.90404@meshcoding.com> (raw)
In-Reply-To: <1434890572-3199-4-git-send-email-sven@narfation.org>
[-- Attachment #1: Type: text/plain, Size: 856 bytes --]
On 21/06/15 14:42, Sven Eckelmann wrote:
> The TVLV for the gw_bandwidth stores everything as u32. But the
> gw_bandwidth reads the signed long which limits the maximum value to
> (2 ** 31 - 1) on systems with 4 byte long. Also the input value is always
> converted from either Mibit/s or Kibit/s to 100Kibit/s. This reduces the
> values even further when the user sets it via the default unit Kibit/s. It
> may even cause an integer overflow and end up with a value the user never
> intended.
>
> Instead read the values as u64, check for possible overflows, do the unit
> adjustments and then reduce the size to u32.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v2:
> * rebased on current master
shouldn't this patch be for maint as it is also fixing a potential
overflow issue?
--
Antonio Quartulli
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-06-29 9:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-21 12:42 [B.A.T.M.A.N.] [PATCH v2 1/4] batman-adv: Return EINVAL on invalid gw_bandwidth change Sven Eckelmann
2015-06-21 12:42 ` [B.A.T.M.A.N.] [PATCH v2 2/4] batman-adv: Backport kstrtou64 for Linux < 2.6.39 Sven Eckelmann
2015-07-10 8:01 ` Marek Lindner
2015-06-21 12:42 ` [B.A.T.M.A.N.] [PATCH v2 3/4] batman-adv: Define (u|s)(8|16|32|64) limits for Linux < 3.14 Sven Eckelmann
2015-07-10 8:02 ` Marek Lindner
2015-06-21 12:42 ` [B.A.T.M.A.N.] [PATCH v2 4/4] batman-adv: Fix gw_bandwidth calculation on 32 bit systems Sven Eckelmann
2015-06-29 9:47 ` Antonio Quartulli [this message]
2015-06-29 16:16 ` Sven Eckelmann
2015-06-29 16:36 ` Antonio Quartulli
2015-07-10 8:04 ` Marek Lindner
2015-06-28 14:40 ` [B.A.T.M.A.N.] [PATCH v2 1/4] batman-adv: Return EINVAL on invalid gw_bandwidth change Marek Lindner
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=55911414.90404@meshcoding.com \
--to=antonio@meshcoding.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=mareklindner@neomailbox.ch \
--cc=sven@narfation.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.