Re: [PATCH 1/1] net: netlink: Fix multicast group storage allocation for families with more than one groups
From: Matti Vaittinen
Date: Wed Jan 13 2016 - 01:48:20 EST
Hello David & others,
On Tue, Jan 12, 2016 at 04:42:11PM -0500, EXT David Miller wrote:
> But I think your change has an off-by-one bug:
>
> From: Matti Vaittinen <matti.vaittinen@xxxxxxxxx>
> > - if (id >= mc_groups_longs * BITS_PER_LONG) {
> > + if (id + n_groups >= mc_groups_longs * BITS_PER_LONG) {
>
> I think this needs to be "id + n_groups > ". Consider the existing,
> working, case of "n_groups == 1". Now you're adding '1' and therefore
> the test needs to be adjusted from >= to >.
Absolutely. I did patch v2.
Br.
Matti Vaittinen