Re: [PATCH] netlink: fix state reallocation in policy export

2020-08-19 Thread Johannes Berg
On Wed, 2020-08-19 at 12:10 -0700, Jakub Kicinski wrote: > > + memset(&state->policies[state->n_alloc], 0, > > + sizeof(state->policies[0]) * (n_alloc - state->n_alloc)); > > [flex_]array_size() ? To avoid the inevitable follow up from a bot.. Yeah, hmm. I suppose you know this but

Re: [PATCH] netlink: fix state reallocation in policy export

2020-08-19 Thread Jakub Kicinski
On Wed, 19 Aug 2020 12:22:55 +0200 Johannes Berg wrote: > From: Johannes Berg > > Evidently, when I did this previously, we didn't have more than > 10 policies and didn't run into the reallocation path, because > it's missing a memset() for the unused policies. Fix that. > > Fixes: d07dcf9aadd6

[PATCH] netlink: fix state reallocation in policy export

2020-08-19 Thread Johannes Berg
From: Johannes Berg Evidently, when I did this previously, we didn't have more than 10 policies and didn't run into the reallocation path, because it's missing a memset() for the unused policies. Fix that. Fixes: d07dcf9aadd6 ("netlink: add infrastructure to expose policies to userspace") Signe