public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Hoang Le <hoang.h.le@dektech.com.au>
Cc: jon.maloy@ericsson.com, maloy@donjonn.com,
	ying.xue@windriver.com, netdev@vger.kernel.org,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [iproute2-next] tipc: support interface name when activating UDP bearer
Date: Thu, 11 Oct 2018 08:04:35 -0700	[thread overview]
Message-ID: <20181011080435.25d4827a@xeon-e3> (raw)
In-Reply-To: <20181011020708.7585-1-hoang.h.le@dektech.com.au>

On Thu, 11 Oct 2018 09:07:08 +0700
Hoang Le <hoang.h.le@dektech.com.au> wrote:

This looks fine.

> +static int cmd_bearer_validate_and_get_addr(const char *name, char *straddr)
> +{
> +	struct ifreq ifc;
> +	struct sockaddr_in *ip4addr;
> +	struct sockaddr_in6 *ip6addr;
> +	int fd = 0;
> +
> +	if (!name || !straddr)
> +		return 0;
> +
> +	fd = socket(PF_INET, SOCK_DGRAM, 0);

Will goahead and apply but minor nits.

The initialization of fd to zero is unnecessary.
This function is return 0, -1, or -EINVAL but only caller only cares about
zero or non-zero.

      reply	other threads:[~2018-10-11 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-11  2:07 [iproute2-next] tipc: support interface name when activating UDP bearer Hoang Le
2018-10-11 15:04 ` Stephen Hemminger [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=20181011080435.25d4827a@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=hoang.h.le@dektech.com.au \
    --cc=jon.maloy@ericsson.com \
    --cc=maloy@donjonn.com \
    --cc=netdev@vger.kernel.org \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=ying.xue@windriver.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox