lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120902104107.GB8982@redhat.com>
Date:	Sun, 2 Sep 2012 13:41:07 +0300
From:	Dan Kenigsberg <danken@...hat.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	netdev@...r.kernel.org, Stephen Hemminger <shemminger@...tta.com>
Subject: Re: [iproute2][PATCH] tc: mirred target: do not report non-existing
 devices

On Thu, Aug 30, 2012 at 08:01:54AM -0700, Eric Dumazet wrote:
> On Thu, 2012-08-30 at 17:51 +0300, Dan Kenigsberg wrote:
> > Currently, if a mirred target device is removed, `tc filter show`
> > does not reveal the fact. Instead, it replaces the original name of the
> > device with the default output of ll_map:ll_idx_n2a().
> > 
> > This is unfortunate, since one cannot differ between this case and a valid
> > mirroring target device named 'if17'.
> > 
> > It seems that the original code meant to report an error message in this
> > case, but it does not, since ll_index_to_name() never returns 0. I would
> > not like to bail out in case of an error, since the user would still be
> > interested to know what are the other details of the action.
> > 
> > Signed-off-by: Dan Kenigsberg <danken@...hat.com>
> > ---
> >  lib/ll_map.c  |   13 +++++++++++++
> >  tc/m_mirred.c |   10 ++++------
> >  2 files changed, 17 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/ll_map.c b/lib/ll_map.c
> > index 1ca781e..8ceef41 100644
> > --- a/lib/ll_map.c
> > +++ b/lib/ll_map.c
> > @@ -108,6 +108,19 @@ const char *ll_idx_n2a(unsigned idx, char *buf)
> >  	return buf;
> >  }
> >  
> > +char *ll_index_exists(unsigned idx)
> > +{
> > +	const struct ll_cache *im;
> > +
> > +	if (idx == 0)
> > +		return 0;
> > +
> > +	for (im = idxhead(idx); im; im = im->idx_next)
> > +		if (im->index == idx)
> > +			return 1;
> > +
> > +	return 0;
> > +}
> >  
> 
> I am curious to know what compiler accepted this.

It was gcc. gcc 2> /dev/null || :, to be exact.

Sorry, fixed patch follows.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ