All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Maxim Petrov <mmrmaximuzz@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2] libnetlink: fix socket leak in rtnl_open_byproto()
Date: Fri, 11 Feb 2022 10:35:13 -0800	[thread overview]
Message-ID: <20220211103513.2ebc5615@hermes.local> (raw)
In-Reply-To: <8da15fe8-92be-ee9c-0c45-1a4af38fc9bd@gmail.com>

On Fri, 11 Feb 2022 21:30:11 +0300
Maxim Petrov <mmrmaximuzz@gmail.com> wrote:

> Hello Stephen!
> 
> On 2022-02-11 01:19 UTC, Stephen Hemminger wrote:
> > +	} else {
> > +		rth->seq = time(NULL);
> > +		return 0;
> >  	}  
> 
> For me it looks slightly alien as the normal flow jumps from one 'else if' to
> another, and the final return statement is hidden inside the else block. The
> original version is straightforward and less surprising.
> 
> > Can do the same thing without introducing a goto  
> But what's wrong with the goto here? I thought it is a perfectly legal C way to
> handle errors, and iproute2 uses it for that purpose almost everywhere.

Ok, either way. personal preference only.

  reply	other threads:[~2022-02-11 18:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 17:20 [PATCH iproute2] libnetlink: fix socket leak in rtnl_open_byproto() Maxim Petrov
2022-02-11  1:19 ` Stephen Hemminger
2022-02-11 18:30   ` Maxim Petrov
2022-02-11 18:35     ` Stephen Hemminger [this message]
2022-02-11 19:40 ` Stephen Hemminger

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=20220211103513.2ebc5615@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=mmrmaximuzz@gmail.com \
    --cc=netdev@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.