All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ryan O'Hara" <rohara@redhat.com>
To: Julian Anastasov <ja@ssi.bg>
Cc: Simon Horman <horms@verge.net.au>, lvs-devel@vger.kernel.org
Subject: Re: [PATCH] ipvsadm: Fix svc->pe_name conditional
Date: Tue, 20 Aug 2013 09:00:59 -0500	[thread overview]
Message-ID: <20130820140058.GD14857@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1308200924430.1698@ja.ssi.bg>

On Tue, Aug 20, 2013 at 09:35:49AM +0300, Julian Anastasov wrote:
> 
> 	Hello,
> 
> On Mon, 19 Aug 2013, Ryan O'Hara wrote:
> 
> > On Mon, Aug 19, 2013 at 06:27:21PM +0300, Julian Anastasov wrote:
> > > 
> > > 	May be they can use 'goto' instead of 'return':
> > > 
> > > 	if (condition) {
> > > 		errno = XXX;
> > > 		goto out_err;
> > > 	}
> > > 
> > > 	and funcs can have such exit point:
> > > 
> > > out_err:
> > > 	free stuff on error
> > > 	return ret;
> > 
> > OK. It looks like ipvs_get_service() is the only function with a
> > potential leak. The other functions that call any of the CHECK_*
> > macros will just get an 'out_err: return -1'.
> 
> 	Yes
> 
> > I also noticed that CHECK_COMPAT_DEST can be removed. This macro
> > simply calls CHECK_IPV4, which is also called by CHECK_COMPAT_SVC. I
> > noticed that CHECK_COMPAT_DEST is only called after CHECK_COMPAT_SVC,
> > so this macro can be removed entirely. Agree?
> 
> 	No. It looks like the macros work with more
> than one structure: svc and dest. Same was for CHECK_PE
> where both structs were supported: ipvs_service_entry_t and
> ipvs_service_t when CHECK_PE was called from CHECK_COMPAT_SVC.
> 
> 	CHECK_COMPAT_SVC does not check the dest->af,
> it checks svc->af. Without both checks, svc can come
> with address from AF_INET family while -r option has address
> from AF_INET6 family. IMHO, we need just the return->goto
> change.

You're right. Not sure how I missed that.

Ryan

      reply	other threads:[~2013-08-20 14:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18 16:41 [PATCH] ipvsadm: Fix svc->pe_name conditional Ryan O'Hara
2013-08-18 18:13 ` Julian Anastasov
2013-08-19 14:52   ` Ryan O'Hara
2013-08-19 15:27     ` Julian Anastasov
2013-08-19 20:40       ` Ryan O'Hara
2013-08-20  0:28         ` Simon Horman
2013-08-20  6:35         ` Julian Anastasov
2013-08-20 14:00           ` Ryan O'Hara [this message]

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=20130820140058.GD14857@redhat.com \
    --to=rohara@redhat.com \
    --cc=horms@verge.net.au \
    --cc=ja@ssi.bg \
    --cc=lvs-devel@vger.kernel.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.