Subject: Re: [iproute PATCH 03/51] ipaddress: Make buffer for filter.flushb static

From: Phil Sutter <[email-masked]>
Date: Tue, 15 Aug 2017 18:11:32 +0200

On Tue, Aug 15, 2017 at 08:13:08AM -0700, Stephen Hemminger wrote:
> On Sat, 12 Aug 2017 14:04:22 +0200
> Phil Sutter <[email-masked]> wrote:
> 
> > The buffer is accessed outside of the function defining it, so make it
> > static.
> > 
> > Signed-off-by: Phil Sutter <[email-masked]>
> 
> Where does a function access this buffer which is not a sibling?

flushb is (was) an auto-variable of ipaddr_flush() which makes
filter.flushb point to it. That pointer is dereferenced from
rtnl_send_check() called by flush_update() and from print_addrinfo(). I
have to admit, the code around flushing addresses is a bit of a mystery
to me, but I don't think it's safe to access function local storage from
outside of it's scope.

Cheers, Phil